我在我的WPF应用程序中使用Windows 10的API“Passport”和“Windows Hello”。
bool keyCredentialAvailable = await KeyCredentialManager.IsSupportedAsync();
if (keyCredentialAvailable)
{
KeyCredentialRetrievalResult keyCreationResult = await KeyCredentialManager.RequestCreateAsync("Hi", KeyCredentialCreationOption.ReplaceExisting);
}
RequestCreateAsync
方法会打开一个弹出窗口,要求进行生物识别或输入pin码。该弹出窗口在MainWindow后面的截图中可见。
我没有任何关于此弹出窗口的参考,无法将其置于前台。同时,我在MainWindow的Loaded
方法中调用此方法,以确保MainWindow已完全加载。