protected ErrorWindow(Exception ex, ICloseable parent) { InitializeComponent(); textBoxName.Text = ex.Message; textBoxDetails.Text = ex.TargetSite.ToString(); textBoxStackTrace.Text = ex.StackTrace; }
/// <summary> /// Runs the application's main loop until the <see cref="ICloseable"/> is closed. /// </summary> /// <param name="closable">The closable to track</param> public void Run(ICloseable closable) { var source = new CancellationTokenSource(); closable.Closed += (s, e) => source.Cancel(); Dispatcher.UIThread.MainLoop(source.Token); }
public static DialogResult ShowDialog(Exception ex, ICloseable parent) { ErrorWindow win = new ErrorWindow(ex, parent); return win.ShowDialog(); }
/// <summary> /// Methods for when the Dialog Ok button is pressed /// </summary> /// <param name="parameter"></param> private void Ok(ICloseable parameter) { DialogResult = true; // Close this dialog parameter.Close(); }
/// <summary> /// Methods for when the Dialog Cancel button is pressed /// </summary> /// <param name="parameter"></param> private void Cancel(ICloseable parameter) { DialogResult = false; // Close this dialog parameter.Close(); }
private void CloseWindow(ICloseable window) { window?.Close(); }
public static DialogResult ShowDialog(Exception ex, ICloseable parent) { ErrorWindow win = new ErrorWindow(ex, parent); return(win.ShowDialog()); }
public MainWindow(ICloseable context) { InitializeComponent(); context.CloseRequest += (s, e) => this.Close(); }