在我的应用中,当出现任何未处理的异常时,我希望显示一条消息对话框。但是似乎当抛出未处理的异常时,对话框消息没有出现,显示消息弹出框是否有效?此外,在MSDN文档中,我没有找到太多有关它的信息。
下面是我使用的测试代码:
下面是我使用的测试代码:
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
this.UnhandledException += App_UnhandledException;
}
private async void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
MessageDialog dialog = new MessageDialog("Unhandled Execption", "Exception");
await dialog.ShowAsync();
}
Dialog.Show
的同步版本吗? - Hamlet Hakobyan