C# Windows安全弹出窗口出现在主应用程序窗口后面

C# Windows安全弹出窗口出现在主应用程序窗口后面,c#,wpf,windows,windows-security,C#,Wpf,Windows,Windows Security,我正在WPF应用程序中使用Windows10API“Passport”和“WindowHello” bool keyCredentialAvailable = await KeyCredentialManager.IsSupportedAsync(); if (keyCredentialAvailable) { KeyCredentialRetrievalResult keyCreationResult = await KeyCredentialManager.RequestCrea

我正在WPF应用程序中使用Windows10API“Passport”和“WindowHello”

bool keyCredentialAvailable = await KeyCredentialManager.IsSupportedAsync();
if (keyCredentialAvailable)
{
      KeyCredentialRetrievalResult keyCreationResult = await KeyCredentialManager.RequestCreateAsync("Hi", KeyCredentialCreationOption.ReplaceExisting);

}
RequestCreateAsync
方法打开弹出窗口,询问生物特征或pin。在主窗口后面的屏幕截图中可见

我没有这个弹出窗口的任何参考,我可以把它放在前面。另外,我在主窗口的
Loaded
方法上调用此方法,以便确认主窗口已完全加载

弹出式定位问题

预期定位
首先,检查函数是否异步

private async void SignInPassport()
{
 bool keyCredentialAvailable = await KeyCredentialManager.IsSupportedAsync();
 if (keyCredentialAvailable)
 {
  KeyCredentialRetrievalResult keyCreationResult = await KeyCredentialManager.RequestCreateAsync("Hi",KeyCredentialCreationOption.ReplaceExisting);
  }
}

如果这不能解决您的问题,请尝试此

您能展示您正在使用的代码吗?我的意思是,我以前从未使用过此api/功能,但即使我想要,我也不知道如何测试它to@TheGeneral我已经用代码更新了问题,并期望result@Heena,您在发布问题后找到答案了吗?我也面临着这个问题,搜索solutionfunction是Async
private Async void MainWindow\u LoadedAsync(对象发送方,RoutedEventArgs e)
我已经检查了您共享的链接。它在UWP中,我的应用程序在WPF中。当我创建发布版本时,我面临这个问题。我能为UWP创建一个构建并验证它吗?是的,你能为UWP创建一个构建。