private void App_OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs args) { #if !DEBUG args.Handled = true; var wnd = new CrashWindow(args.Exception); wnd.ShowDialog(); Environment.Exit(1); #endif }