예제 #1
0
        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            //MessageBoxResult result = MessageBox.Show(this, "确定要退出游戏吗", "信息提示", MessageBoxButton.YesNo, MessageBoxImage.Information);

            //if(result == MessageBoxResult.Yes)
            //{
            //    flashShow.Dispose();
            //}
            //else
            //{
            //    e.Cancel = true;
            //}

            ConfirmWindow cw = new ConfirmWindow();

            cw.Owner = this;
            bool?result = cw.ShowDialog();

            if (result == true)
            {
                flashShow.Dispose();
            }
            else
            {
                e.Cancel = true;
            }
        }
예제 #2
0
        private void RemoveButton_Click(object sender, RoutedEventArgs e)
        {
            ConfirmWindow cw = new ConfirmWindow();

            //cw.Owner = ((this.Parent as WrapPanel).Parent as Decorator).Parent as Window;
            cw.Owner = App.Current.MainWindow;
            bool?result = cw.ShowDialog();

            if (result == true)
            {
                //System.IO.File.Delete("");
            }
        }