public ViewPage(Question question, QuestionPage questpage) { Qpage = questpage; Quest = question; InitializeComponent(); QuestTextBlock.Text = Quest.FieldQuestion; if (Quest.Author == "") { Quest.Author = "-"; } AuthorTextBlock.Text = $"Автор: {Quest.Author}"; if (question.PicturePath != "") { var path = "Images/" + question.PicturePath; QuestionImage.Source = BitmapFrame.Create(new Uri(@"pack://application:,,,/Images/" + question.PicturePath)); ImageButton.Visibility = Visibility.Visible; } }
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); } } }