示例#1
0
        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();
            }
        }
示例#2
0
        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();
            }
        }