private void deleteClick(object sender, RoutedEventArgs e) { Button button = sender as System.Windows.Controls.Button; Synoptic synoptic = button.DataContext as Synoptic; if (MessageBox.Show("Are you sure you want to delete this synoptic ?", "Confirmation", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { synoptic.Delete(synoptic.Id.ToString()); RefreshUserList(); } else { return; } }
private void btnDeleteAll_Click(object sender, RoutedEventArgs e) { if (MessageBox.Show("Are you sure you want to delete all this information?", "Confirmation", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { foreach (Synoptic u in SynopticGrid.SelectedItems) { u.Delete(u.Id.ToString()); } RefreshUserList(); } else { return; } }