private void BtnEditInjury_Click(object sender, RoutedEventArgs e) { try { if (ListViewInjuries.SelectedItem is FootDev2.AppData.Injuries injury) { VarIdInjury = injury.IdInjToPla; AddInjury addInjury = new AddInjury(ListViewInjuries.SelectedItem as FootDev2.AppData.Injuries); this.Opacity = 0.3; Filter(); addInjury.ShowDialog(); Filter(); this.Opacity = 1; } else { MessageBox.Show("You did not select player", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } catch { MessageBox.Show("Error", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void BtnAddInjury_Click(object sender, RoutedEventArgs e) { AddInjury addInjury = new AddInjury(); this.Opacity = 0.3; Filter(); addInjury.ShowDialog(); Filter(); this.Opacity = 1; }