AppStore.Templates.QuizPage.Options_Checked C# (CSharp) Method

Options_Checked() private method

Executed when any of the options are checked.
private Options_Checked ( object sender, RoutedEventArgs e ) : void
sender object Object Sender is a parameter called Sender that contains a reference to the control/object that raised the event.
e RoutedEventArgs RoutedEventArgs e is a parameter called e that contains the event data, see the RoutedEventArgs MSDN page for more information.
return void
        private void Options_Checked(object sender, RoutedEventArgs e)
        {
            Next.IsEnabled = true;
            RadioButton originalAnswer = (RadioButton)QuestionContent.Children.ElementAt(iCurrentCorrectAnswer+2);
            RadioButton yourAnswer = sender as RadioButton;
            if (yourAnswer.Tag.ToString().Equals(iCurrentCorrectAnswer + ""))
            {
                quiz.setTotalCorrect(quiz.getTotalCorrect() + 1);
            }
            else
            {
                quiz.setTotalWrong(quiz.getTotalWrong() + 1);
                yourAnswer.BorderBrush = new SolidColorBrush(Windows.UI.Colors.Red);
                yourAnswer.Background = new SolidColorBrush(Windows.UI.Colors.Red);
            }
            originalAnswer.BorderBrush = new SolidColorBrush(Windows.UI.Colors.DarkGreen);
            originalAnswer.Background = new SolidColorBrush(Windows.UI.Colors.DarkGreen);
            Option1.IsEnabled = false;
            Option2.IsEnabled = false;
            Option3.IsEnabled = false;
            Option4.IsEnabled = false;
        }