Hello,
My application shows a question and possible answers on that question. Now I want to give the correct answer (specified in the "CorrectAnswer" property) a green color. Can someone help me? Thanks.
public class Exercise
{
public string QuestionText { get; set; }
public int CorrectAnswer { get; set; }
public Answer[] Answers { get; set; }
...
}
public class Answer
{
public string AnswerText { get; set; }
...
}
XAML:
<StackPanel Orientation="Vertical">
<Label Content="{Binding Path=QuestionText}"></Label>
<ItemsControl ItemsSource="{Binding Path=Answers}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Label Content="{Binding Path=AnswerText}"></Label>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>