Exemplo n.º 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();
            }
        }
Exemplo n.º 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();
            }
        }