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