public ManifestationsView() { InitializeComponent(); SelectedManifestation = null; DataContext = this; Manifestations = Repository.GetInstance().Manifestations; FilterInput.Focus(); }
private void editBtnClicked(object sender, RoutedEventArgs e) { model.Manifestation target = SelectedManifestation; if (target == null) { MessageBox.Show("Please select a manifestation to edit.", "Edit failed", MessageBoxButton.OK, MessageBoxImage.Warning); return; } mainWindow.showManifestationEditView(target.Id); }
public void scrollTo(string ManifestationId) { foreach (model.Manifestation manif in Manifestations) { if (manif.Id == ManifestationId) { SelectedManifestation = manif; ManifestationsTable.ScrollIntoView(manif); break; } } }
private void DeleteBtnClicked(object sender, RoutedEventArgs e) { model.Manifestation target = SelectedManifestation; if (target == null) { MessageBox.Show("Please select a manifestation to delete.", "Delete failed", MessageBoxButton.OK, MessageBoxImage.Warning); return; } Repository rep = Repository.GetInstance(); MessageBoxResult choice = MessageBox.Show($"Are you sure that you want to permanently delete manifestation \"{target.Id}\"?", "Delete manifestation", MessageBoxButton.YesNoCancel); if (choice == MessageBoxResult.Yes) { rep.DeleteManifestation(target.Id); } }