private bool HandleException(Exception exception) { if (UnhandledException == null) { return(false); } var exWrapper = new AysncUnhandledExceptionEventArgs { Exception = exception }; UnhandledException(this, exWrapper); #if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION if (System.Diagnostics.Debugger.IsAttached) { System.Diagnostics.Debugger.Break(); } #endif return(exWrapper.Handled); }
private async void SynchronizationContext_UnhandledException(object sender, AysncUnhandledExceptionEventArgs e) { e.Handled = true; await new MessageDialog($"SynchronizationContext Unhandled Exception:\n{e.Exception.Message}\n{e.Exception.StackTrace}").ShowAsync(); }