void AwfulAboutPanel_EmailAuthorRequested(object sender, EventArgs e) { AboutWindow.IsOpenThenInvoke(false, () => { var email = new Commands.EmailCommand(); email.Subject = "Awful QCS"; email.To = Globals.Constants.AUTHOR_EMAIL; email.Execute(null); }); }
// Code to execute if a navigation fails private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) { e.Handled = true; Deployment.Current.Dispatcher.BeginInvoke(() => { if (App.Settings.LoggingEnabled) { var result = MessageBox.Show("A navigation error occured. Tap OK to report this error to the author.", ":'(", MessageBoxButton.OKCancel); if (result == MessageBoxResult.OK) { Commands.EmailCommand email = new Commands.EmailCommand(); email.To = Globals.Constants.AUTHOR_EMAIL; email.Subject = "Navigation Error"; email.Body = string.Format("'{0}'", e.Uri); email.Execute(null); } } if (System.Diagnostics.Debugger.IsAttached) { // A navigation has failed; break into the debugger System.Diagnostics.Debugger.Break(); } }); }
// Code to execute on Unhandled Exceptions private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) { e.Handled = true; Deployment.Current.Dispatcher.BeginInvoke(() => { if (App.Settings.LoggingEnabled) { var result = MessageBox.Show("An unknown error occured. Tap OK to report this error to the author.", ":'(", MessageBoxButton.OKCancel); if (result == MessageBoxResult.OK) { Commands.EmailCommand email = new Commands.EmailCommand(); email.To = Globals.Constants.AUTHOR_EMAIL; email.Subject = "Unknown Error"; email.Body = string.Format("[{0}] - {1}", e.ExceptionObject.Message, e.ExceptionObject.StackTrace); email.Execute(null); } if (System.Diagnostics.Debugger.IsAttached) { // An unhandled exception has occurred; break into the debugger MessageBox.Show(e.ExceptionObject.Message, "error", MessageBoxButton.OK); System.Diagnostics.Debugger.Break(); } } }); }