private void eventsListBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { ListPage.playersListView.ItemsSource = PlayersHelper.EventSelectionChangedPlayers(eventsListBox.SelectedItem as Event); ListPage.tournamentPlayersListView.ItemsSource = TornamentPlayersHelper.EventSelectionChangedTournament(eventsListBox.SelectedItem as Event); DrawsPage.EventChangedDrawing(); ListPage.cmbBoxCategory.SelectedIndex = ListPage.cmbBoxCategory.Items.Count - 1; }
public DoublesAdd(BadmintonContext context, Event selectedEvent, Player player, TornamentPlayersHelper tornamentPlayersHelper) { InitializeComponent(); Context = context; CurrentPlayer = player; TitleChanger(player, selectedEvent); TornamentPlayersHelper = tornamentPlayersHelper; PlayersHelper = new PlayersHelper(Context); PlayersHelper.PlayersLoad(); SelectedEvent = selectedEvent; if (!SelectedEvent.Type.TypeName.Equals("Микст")) { playersListView.ItemsSource = PlayersHelper.EventSelectionChangedPlayers(SelectedEvent).Where(p => p.PlayerSurName != player.PlayerSurName && p.PlayerName != player.PlayerName); } else if (player.Sex.Equals("Мужской")) { playersListView.ItemsSource = PlayersHelper.EventSelectionChangedPlayers(SelectedEvent).Where(p => p.Sex.Equals("Женский")); } else { playersListView.ItemsSource = PlayersHelper.EventSelectionChangedPlayers(SelectedEvent).Where(p => p.Sex.Equals("Мужской")); } }
public MainPage(Tournament tournament) { WaitWindow waitWindow = new WaitWindow(); waitWindow.Show(); InitializeComponent(); CurrentTournament = tournament; Nums = new Nums(); Context = new BadmintonContext(); ListPage = new ListPage(this); changerFrame.Navigate(ListPage); #region LoadContext Context.Cities.Load(); Context.Grades.Load(); Context.Clubs.Load(); Context.Coaches.Load(); Context.Unions.Load(); Context.TeamsTournaments.Load(); Context.PlayersTeams.Load(); #endregion TornamentPlayersHelper = new TornamentPlayersHelper(Context, CurrentTournament); EventsHelper = new EventsHelper(Context, CurrentTournament); PlayersHelper = new PlayersHelper(Context); Context.Configuration.AutoDetectChangesEnabled = true; EventsHelper.EventsLoad(); PlayersHelper.PlayersLoad(); TornamentPlayersHelper.TeamTournamentsLoad(); eventsListBox.ItemsSource = EventsHelper.EventsList; DrawsPage = new DrawsPage(this); if (eventsListBox.Items.Count > 0) { eventsListBox.SelectedIndex = 0; } waitWindow.Close(); }