private async void ContinueGame_Click(object sender, RoutedEventArgs e) { if (!processing) { processing = true; if (CurrentQuestionSheet.ShowingMode == QuestionPageShowingMode.ShowinQuestion) { App.CurrentApp.CurrentRecord.Score += CurrentQuestionSheet.Evaluate().Score; ScoreBlock.Text = App.CurrentApp.CurrentRecord.Score.ToString() + " امتیاز"; KasrTextblock.Visibility = Visibility.Collapsed; await CurrentQuestionSheet.ShowAnswer(); } else { if (Questions.Count > 0) { QuestionFrame.Navigate(Questions.Dequeue()); } else { App.MainMenu.PageFrame.Navigate(new Finsihed(storeData: true)); } } await Task.Delay(200); processing = false; } }
private void PreviousButton_Click(object sender, RoutedEventArgs e) { if (QuestionFrame.CanGoBack && currentPage > 0) { QuestionFrame.GoBack(); currentPage--; QuestionNumberTextBlock.Text = $"Question {currentPage + 1} of {Test.Questions.Count}"; } }
private void NextButton_Click(object sender, RoutedEventArgs e) { if (QuestionFrame.CanGoForward) { QuestionFrame.GoForward(); currentPage++; QuestionNumberTextBlock.Text = $"Question {currentPage + 1} of {Test.Questions.Count}"; } else if (currentPage < Test.Questions.Count - 1) { CreatePage(); currentPage++; QuestionNumberTextBlock.Text = $"Question {currentPage + 1} of {Test.Questions.Count}"; } }
private void QuestionFrame_Navigated(object sender, NavigationEventArgs e) { try { QuestionTitle.Text = ((Page)QuestionFrame.Content).Title; QuestionTitle.MarginFadeInAnimation(new Thickness(20, 0, 0, 0), new Thickness(0), TimeSpan.FromMilliseconds(500)); try { QuestionFrame.MarginFadeInAnimation(new Thickness(20, 0, 0, 0), new Thickness(0), TimeSpan.FromMilliseconds(500)); KasrTextblock.Visibility = Visibility.Visible; } catch { } } catch { } }
private void QLoader_Loaded(object sender, RoutedEventArgs e) { QuestionFrame.Navigate(Questions.Dequeue()); ScoreBlock.Text = "۰ امتیاز"; }