Skip to content

Commit

Permalink
Set a GroupName when creating new WinUI RadioButtons
Browse files Browse the repository at this point in the history
This fixes issue #11418
  • Loading branch information
jstedfast committed Feb 28, 2023
1 parent 21b6043 commit 876c4aa
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
using Microsoft.UI.Xaml;
using System;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;

namespace Microsoft.Maui.Handlers
{
public partial class RadioButtonHandler : ViewHandler<IRadioButton, RadioButton>
{
protected override RadioButton CreatePlatformView() => new RadioButton();
protected override RadioButton CreatePlatformView()
{
// Note: We set a random GUID as the GroupName as part of the work-around in https://github.com/dotnet/maui/issues/11418
return new RadioButton() { GroupName = Guid.NewGuid().ToString() };
}

protected override void ConnectHandler(RadioButton platformView)
{
Expand Down

0 comments on commit 876c4aa

Please sign in to comment.