public void OnUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { var ew = new ErrorWindow(); var t = new Thread(new ParameterizedThreadStart(ew.ShowError)) { CurrentUICulture = new System.Globalization.CultureInfo("en-US") }; t.Start(e.Exception); e.Handled = true; if (ew.ShowDialog() != true) { if (CurrentBackground != null) { CurrentBackground.Closing -= CurrentBackground.OnClosing; } CurrentBackground.Close(); Close(); } }