Exemple #1
0
        //TODO Unhandled error
        private async static void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
        {
            //UI exception
            e.Handled = true;//Don't shut down app

            var dialog = new Controls.ErrorDialog
            {
                ErrorException = e.Exception
            };
            await dialog.ShowAsync();
        }
Exemple #2
0
 private static async void OnUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
 {
     //backgound thead ,task thread
     e.SetObserved();//Don't shut down app
     await
     Window.Current.Dispatcher.TryRunAsync(
         Windows.UI.Core.CoreDispatcherPriority.Normal, async() =>
     {
         var dialog = new Controls.ErrorDialog
         {
             ErrorException = e.Exception
         };
         await dialog.ShowAsync();
     });
 }