Hello,
Welcome to our Microsoft Q&A platform!
If i write text instead {Binding Name} it appears in radio button content as expected
This is because you use property-element syntax for the Content property of the RadioButton
. The BindingContext
of the radioButton and the 'Content' will be different, the 'Content''s BindingContext
will be null. This is why the data binding of RadioButton.GroupName
property works fine, but the Content not.
Please use 'Content' property as the XML attribute instead. Change the code like below:
<DataTemplate x:Key="RadioTemplate" x:DataType="dtoModels:PossibleAnswer">
<Frame Padding="10,5,10,5" CornerRadius="10" HasShadow="True">
<RadioButton GroupName="{Binding GroupId}" IsChecked="{Binding IsChecked}" Style="{StaticResource RadioButtonSurvey}" Content="{Binding Name}"/>
</Frame>
</DataTemplate>
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.