private void PlayBut_Click(object sender, RoutedEventArgs e) { try { if (!current_tournament.DoNextPlay()) { MessageBox.Show("This Game is ended", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } TournamentListB.SelectedIndex = TournamentListB.Items.Count - 1; TournamentListB.ScrollIntoView(TournamentListB.SelectedItem); } catch (Exception) { MessageBox.Show("This Game is ended", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }