private void deleteCommandAction(object obj) { var dialig = MessageBox.Show("Yakin Menghapus data ?", "Confirm", MessageBoxButton.YesNo); if (dialig == MessageBoxResult.Yes) { var isDelete = data.Remove(SelectedItem); if (isDelete) { MessageBox.Show("Data Berhasil Dihapus"); Source.Remove(SelectedItem); SourceView.Refresh(); } else { MessageBox.Show("Data Gagal Dihapus"); } } }
public static bool Remove(int cityID) { return(_cities.Remove(cityID)); }