private static void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { Logger.Error(e.Exception, "Uncaught exception in WPF thread"); e.Handled = true; _errorReportHelper.ShowErrorReport(e.Exception); System.Windows.Application.Current.Shutdown(1); }