Open dainius-r opened 6 months ago
Verified this issue with Visual Studio 17.10.0 Preview 2(8.0.10). Not repro on android platform with above code. Please check out the sample project I provided. MauiApp15 1.zip
@Zhanglirong-Winnie I have updated your project please see MainPage.xaml.cs line 15 MauiApp15.v2.zip
The key point is if you do not set GroupName = "anyTextValue"
, and leave it to null
, then binding will not work for Selection
propery and you will not get selected value.
But if you will provide any text value to RadioButtonGroup.GroupName
then selection binding works, maybe this is by design, but that is not specified in documentation
If this is be design that RadioButtonGroup.GroupName
must have a value, that this issue can be closed.
According to the user's latest comments and sample projects, this problem can be reproduced if the GroupName value is left empty. MauiApp15.v2.zip
Hello @dainius-r, we've modified this as a proposal to allow for binding without a GroupName since it would take some changes to do. In the meanwhile, I've updated the documentation to bring attention to the necessity of having a GroupName for RadioButtonGroup. Thanks!
Description
When trying to use RadioButton selected value, binding to group property not works and currently is not usable. Using example from: https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/radiobutton?view=net-maui-8.0#respond-to-radiobutton-state-changes
Steps to Reproduce
Add viewModel code:
Link to public reproduction project repository
No response
Version with bug
8.0.10 SR3
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 13 - API 33
Did you find any workaround?
It only works when set RadioButtonGroup.GroupName to some static value
Relevant log output
No response