public static void ShowDialog(Exception exception, Window owner = null)
        {
            try
            {
                Debug.WriteLine(exception);

                var window = new ExceptionWindow(exception, owner);

                window.ShowDialog();
            }
            catch (Exception)
            {
                if (owner != null)
                {
                    System.Windows.MessageBox.Show(owner, exception.ToString());
                }
                else
                {
                    System.Windows.MessageBox.Show(exception.ToString());
                }
            }
        }
예제 #2
0
 private void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
 {
     ExceptionWindow.ShowDialog(e.Exception);
     e.Handled = true;
 }