public static void FillUsersListBox(List <User> jumpers)
 {
     App.Current.Dispatcher.Invoke((Action) delegate
     {
         AdminMainPage currentPage            = App.MainWindowRef.Main.Content as AdminMainPage;
         currentPage.usersListBox.ItemsSource = jumpers;
     });
 }
 public static void FillCompetitionListBox(List <CompetitionWithUser> competitions)
 {
     App.Current.Dispatcher.Invoke((Action) delegate
     {
         AdminMainPage currentPage = App.MainWindowRef.Main.Content as AdminMainPage;
         currentPage.competitionListBox.ItemsSource = competitions;
         currentPage.competitionListBox.UnselectAll();
     });
 }
 private void DisplaySelectedContest(object sender, MouseButtonEventArgs e)
 {
     App.Current.Dispatcher.Invoke((Action) delegate
     {
         AdminMainPage currentPage = App.MainWindowRef.Main.Content as AdminMainPage;
         dynamic data = currentPage.competitionListBox.SelectedItem as dynamic;
         if (data != null)
         {
             int id = data.ID;
             List <User> jumpers = data.Users;
             List <User> judges  = data.Judges;
             Console.WriteLine(id);
             FillUsersListBox(jumpers);
             FillJudgesListBox(judges);
         }
     });
 }