这里在界面按钮事件下除 0 测试,感觉软件还是退出了?
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
DispatcherUnhandledException += App_DispatcherUnhandledException;
}
private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
//throw new NotImplementedException();
MessageBox.Show(e.Exception.Message + "---" + e.ToString());
}
}
标签:捕获,App,OnStartup,DispatcherUnhandledException,WPF,void
From: https://www.cnblogs.com/huvjie/p/17077445.html