private void btnExit_Click(object sender, RoutedEventArgs e) { if (!goBack) { return; } QuitWindow quitWindow = new QuitWindow(); quitWindow.ShowDialog(); if (quitWindow.Mode != QuitMode.Cancel) { Application.Current.Shutdown(); } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (goBack) { return; } QuitWindow quitWindow = new QuitWindow(); quitWindow.ShowDialog(); if (quitWindow.Mode == QuitMode.Cancel) { e.Cancel = true; } else { if (thread != null) { thread.Abort(); } Application.Current.Shutdown(); } }