/// <summary> /// Called when [setting handler]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> private void OnSettingHandler(object sender, RoutedEventArgs e) { try { SettingWindow win = null; try { win = new SettingWindow(); win.Owner = this; win.ShowDialog(); } finally { win.Close(); } } #region Exception Handling catch (Exception ex) { TraceSourceMonitorHelper.Error("UI event handler failed: {0}", ex); } #endregion // Exception Handling }
protected override void OnClosed(EventArgs e) { _settingWindow?.Close(); StopAllFunctions(); base.OnClosed(e); }