diff --git a/PixivFSUWP/App.xaml.cs b/PixivFSUWP/App.xaml.cs index bab8297..1c63497 100644 --- a/PixivFSUWP/App.xaml.cs +++ b/PixivFSUWP/App.xaml.cs @@ -7,6 +7,7 @@ using Windows.ApplicationModel.Activation; using Windows.Foundation; using Windows.Foundation.Collections; +using Windows.UI.Popups; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; @@ -30,6 +31,15 @@ public App() { this.InitializeComponent(); this.Suspending += OnSuspending; + this.UnhandledException += App_UnhandledException; + } + + private async void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) + { + e.Handled = true; + MessageDialog dialog = new MessageDialog(string.Format("Unhandled Execption: {0}\nPlease screenshot for later use.", e.Exception.Message), "Exception"); + await dialog.ShowAsync(); + this.Exit(); } protected override void OnActivated(IActivatedEventArgs args)