private void del_Click_1(object sender, RoutedEventArgs e) { Book item = (Book)dataGrid.SelectedItem; if (item == null) { MessageBox.Show("请选择数据行"); return; } YesOrNoDialog yd = new YesOrNoDialog(); yd.Owner = parentWindow; yd.SetInfo("再次确定是否要删除?"); if (yd.ShowDialog() == false) { return; } if (delete(item) > 0) { this.bookList.Remove(item); this.dataGrid.ItemsSource = bookList; } /* * int ret = sqlite.ExecuteNonQuery("delete from tbl_fgwj where ID_KEY='" + item.idKey + "'"); * if (ret > 0) * { * this.loadDatas(); * MessageBox.Show("删除成功!"); * } */ }
private void exitButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { YesOrNoDialog exitDialog = new YesOrNoDialog(this, "Exit App", "Are You Sure you want to exit the app?", "../Resources/exit.png"); bool? dialogResult = exitDialog.ShowDialog(); if (dialogResult == true) { Application.Current.Shutdown(); } //MessageBoxResult messageBoxResult = MessageBox.Show("Are You Sure?", "Exit Confirmation", MessageBoxButton.YesNo); //if(messageBoxResult == MessageBoxResult.Yes) //{ // Application.Current.Shutdown(); //} }
public static void NotifyBeforeGameQuit() { ObjectPauser.Pause(); YesOrNoDialog.ShowDialog(shownText, QuitGame, Canceled); }
public static void Canceled() { YesOrNoDialog.HideDialog(); ObjectPauser.Resume(); }