当我尝试调用 MessageDialog 时,我的应用程序崩溃并显示以下错误消息:
System.Runtime.InteropServices.COMException: 'Invalid Window Identifier. (0x80070578)'
这发生在 App.xaml.xs 和我为此提议的助手中。
app.xaml 上的代码:
var messageDialog = new MessageDialog("Excedeu o limite de tentativas para fazer login.");
var result = await messageDialog.ShowAsync();
助手代码:
public static async Task ShowAsync(String keyName)
{
var msg = LocalizationHelper.GetValue(keyName);
if (string.IsNullOrWhiteSpace(msg)) msg = keyName;
var messageDialog = new MessageDialog(msg);
await messageDialog.ShowAsync();
}