Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ListBox x:Name="ListBoxQuestionAnswers" ItemsSource="{x:Bind Question.Answers}" SelectionMode="Single" SelectionChanged="ListBoxQuestionAnswers_OnSelectionChanged">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <TextBlock x:Name="TextBlockInListBox" TextWrapping="Wrap" Text="{Binding}"/>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- private void ListBoxQuestionAnswers_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- if (ListBoxQuestionAnswers.SelectedIndex == Question.CorrectAnswerIndex)
- {
- Application.Current.Resources["SystemControlHighlightListAccentLowBrush"] = new SolidColorBrush(Colors.Green);
- Application.Current.Resources["SystemControlHighlightListAccentMediumBrush"] = new SolidColorBrush(Colors.Green);
- }
- else
- {
- Application.Current.Resources["SystemControlHighlightListAccentLowBrush"] = new SolidColorBrush(Colors.Red);
- Application.Current.Resources["SystemControlHighlightListAccentMediumBrush"] = new SolidColorBrush(Colors.Red);
- }
- }
Add Comment
Please, Sign In to add comment