Exemplo n.º 1
0
        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();
        }