/// <summary> /// It populates the question with the index passed into the current view. /// </summary> /// <param name="index">The index of the question which will be populated in the current view.</param> public void populateQuestion(int index) { QuestionNumber.Text = "Question #" + (index + 1) + " of " + iNumberofQuestions; Question.Text = quiz.getQueAnsList().ElementAt(index).getQuestion(); for (int i = 0; i < 4; i++) { ((RadioButton)QuestionContent.Children.ElementAt(i + 3)).Content = quiz.getQueAnsList().ElementAt(index).getAnswerOption().ElementAt(i); } iCurrentCorrectAnswer = quiz.getQueAnsList().ElementAt(index).getOptionNumber(); }
/// <summary> /// The methods provided in this section are simply used to allow /// NavigationHelper to respond to the page's navigation methods. /// <para> /// Page specific logic should be placed in event handlers for the /// <see cref="NavigationHelper.LoadState"/> /// and <see cref="NavigationHelper.SaveState"/>. /// The navigation parameter is available in the LoadState method /// in addition to page state preserved during an earlier session. /// </para> /// </summary> /// <param name="e">Provides data for navigation methods and event /// handlers that cannot cancel the navigation request.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { Frame.BackStack.RemoveAt(Frame.BackStackDepth - 1); quiz = Models.QuizModel.getInstance(); pageTitle.Text = quiz.getQuizName(); iNumberofQuestions = quiz.getQueAnsList().Count; populateQuestion(iQuestionIndex); this.navigationHelper.OnNavigatedTo(e); }
/// <summary> /// The methods provided in this section are simply used to allow /// NavigationHelper to respond to the page's navigation methods. /// <para> /// Page specific logic should be placed in event handlers for the /// <see cref="NavigationHelper.LoadState"/> /// and <see cref="NavigationHelper.SaveState"/>. /// The navigation parameter is available in the LoadState method /// in addition to page state preserved during an earlier session. /// </para> /// </summary> /// <param name="e">Provides data for navigation methods and event /// handlers that cannot cancel the navigation request.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { Frame.BackStack.RemoveAt(Frame.BackStackDepth - 1); quiz = Models.QuizModel.getInstance(); pageTitle.Text = quiz.getQuizName(); iNumberofQuestions = quiz.getQueAnsList().Count; populateQuestion(iQuestionIndex); this.navigationHelper.OnNavigatedTo(e); }