Beispiel #1
0
 /// <summary>
 /// Edit button click event handler
 /// </summary>
 /// <param name="sender">Clicked button object</param>
 /// <param name="e">Event arguments</param>
 private void EditButton_Click(object sender, RoutedEventArgs e)
 {
     if (AnimalsGrid.SelectedItem != null && !AnimalsGrid.SelectedItem.ToString().Contains("Placeholder"))
     {
         Animal        animal        = (Animal)AnimalsGrid.SelectedItem;
         DetailsWindow detailsWindow = new DetailsWindow(AnimalsManager, animal);
         detailsWindow.ShowDialog();
     }
     else
     {
         MessageBox.Show("Najpierw wybierz zwierzę do edycji!", "Błąd", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Add button click event handler
        /// </summary>
        /// <param name="sender">Clicked button object</param>
        /// <param name="e">Event arguments</param>
        private void AddButton_Click(object sender, RoutedEventArgs e)
        {
            DetailsWindow detailsWindow = new DetailsWindow(AnimalsManager);

            detailsWindow.ShowDialog();
        }