public PackPage(User user) { InitializeComponent(); _user = user; var testrepo = new DBRepository(); dBRepository = testrepo; testrepo.LoadData(); UILogic.AdaptPacksForUser(user, testrepo.Packages); PackList.ItemsSource = testrepo.Packages; PointsList.ItemsSource = UILogic.GetScores(user, testrepo.Packages); CheckBoxList.ItemsSource = testrepo.Packages;; }
private void PackList_MouseDoubleClick(object sender, MouseButtonEventArgs e) { var package = PackList.SelectedItem as Package; if (package != null) { package.IsAlreadyPlayed = true; var currSession = UILogic.CreateSession(_user, package, 0); UILogic.AdaptPacksForUser(_user, dBRepository.Packages); UpdateInfo(dBRepository.Packages); var pop = new PopUpWindow(); pop.ShowDialog(); if (pop.gamemode) { var gamepage = new GamePage(package, 1, currSession, this); NavigationService.Navigate(gamepage); } else { var questpage = new QuestionPage(package, this); NavigationService.Navigate(questpage); } } }