private void BtnAddTraining_Click(object sender, RoutedEventArgs e)
        {
            AddTeamTraining addTeamTraining = new AddTeamTraining();

            this.Opacity = 0.3;
            Filter();
            addTeamTraining.ShowDialog();
            Filter();
            this.Opacity = 1;
        }
 private void BtnEditTraining_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (ListViewTeamTrainings.SelectedItem is ViewTeamTrainings teamTraining)
         {
             VarIdTraining = teamTraining.IdTraining;
             AddTeamTraining addTeamTraining = new AddTeamTraining(ListViewTeamTrainings.SelectedItem as ViewTeamTrainings);
             this.Opacity = 0.3;
             Filter();
             addTeamTraining.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);
     }
 }