I have a ItemsControl bound to a string list.
Code:-
List<string> possibleAnswers;
possibleAnswers = GetPossibleAnswers(currentQuestion);
AnswerIC.Items.Clear();
AnswerIC.ItemsSource = possibleAnswers;
Xaml:-
<ItemsControl x:Name="AnswerIC" Grid.Row="1" Margin="0,10,0,10">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel x:Name="AnswerSP" Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<RadioButton GroupName="AnswerRBG" Content="{Binding}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
In a button click event, I am trying to find the content of the checked radio button and am unable to. Anyone with suggestions? And I should probably add I am a complete amateur with Silverlight.
well you can do that like following
1) Register radio button Click event
2) Do
Tag="{Binding}"3)