Hi,@Oladapo Kolawole Osagie . Welcome Microsoft Q&A.
For binding the value of the selected RaidoButton to the property, you could try referring to the code below.
Xaml:
<Window.Resources>
<ObjectDataProvider x:Key="selectOptions" ObjectType="{x:Type local:MyQuestion}" />
<local:RadioButtonCheckedConverter x:Key="RadioButtonCheckedConverter" />
</Window.Resources>
<StackPanel>
<ListView Name="lv" Background="AliceBlue" ItemsSource="{Binding AllQuestions}" SelectedItem="{Binding SelectedQuestion}" SelectionChanged="ListView_SelectionChanged">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Background="LightPink" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Id}" FontSize="24"/>
<TextBlock FontSize="20" Text="{Binding Question}"/>
</StackPanel>
<StackPanel Margin="40,0" >
<RadioButton GroupName="{Binding Id}" FontSize="16" Content="{Binding OptionA}" IsChecked="{Binding SelectedAnswer ,Converter= {StaticResource RadioButtonCheckedConverter}, ConverterParameter={x:Static local:Options.OptionA}}"/>
<RadioButton GroupName="{Binding Id}" FontSize="16" Content="{Binding OptionB}" IsChecked="{Binding SelectedAnswer ,Converter= {StaticResource RadioButtonCheckedConverter}, ConverterParameter={x:Static local:Options.OptionB}}" />
<RadioButton GroupName="{Binding Id}" FontSize="16" Content="{Binding OptionC}" IsChecked="{Binding SelectedAnswer ,Converter= {StaticResource RadioButtonCheckedConverter}, ConverterParameter={x:Static local:Options.OptionC}}"/>
<RadioButton GroupName="{Binding Id}" FontSize="16" Content="{Binding OptionD}" IsChecked="{Binding SelectedAnswer ,Converter= {StaticResource RadioButtonCheckedConverter}, ConverterParameter={x:Static local:Options.OptionD}}"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<TextBlock x:Name="tb" Text="{Binding ElementName=lv ,Path=SelectedItem.SelectedAnswer , UpdateSourceTrigger=PropertyChanged}" Height="50" Background="LightGreen" />
</StackPanel>
Codebehind: You can click on the .txt file to view the code.
The result:
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our [documentation][5] to enable e-mail notifications if you want to receive the related email notification for this thread.
[5]: https://learn.microsoft.com/en-us/answers/articles/67444/email-notifications.html