public UnhandledExceptionDialogViewModel(UnhandledExceptionDialog view, Exception exception, bool canContinue)
 {
     View        = view;
     Exception   = exception;
     CanContinue = canContinue;
     StackTrace  = exception.GetFullStackTrace();
 }
Beispiel #2
0
        private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
        {
            e.Handled = true;

            if (CSharp.Try(() => MainWindowViewModel.Singleton.IsInitialized))
            {
                if (new UnhandledExceptionDialog(e.Exception, true).ShowDialog() == true)
                {
                    Shutdown();
                }
            }
            else
            {
                UnhandledExceptionDialog dialog = new UnhandledExceptionDialog(e.Exception, false);
                dialog.Show();
                dialog.Activate();
            }
        }