private void ButtonEditAnimal_OnClick(object sender, RoutedEventArgs e) { var animal = (AnimalDetailed)ListBoxResultList.SelectedItem; if (animal != null) { AddOrEditAnimal addOrEdit = new AddOrEditAnimal(animal); addOrEdit.Show(); } else { MessageBox.Show("Inget djur är markerat för redigering."); } }
private void MenuItemAddAnimals_OnClick(object sender, RoutedEventArgs e) { AddOrEditAnimal addOrEdit = new AddOrEditAnimal(); addOrEdit.Show(); }