Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 710d728

Browse files
committed
Rebase and make it run
1 parent d8fad78 commit 710d728

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Xamarin.Forms.Core/RadioButton.cs

+14-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
namespace Xamarin.Forms
77
{
88
[RenderWith(typeof(_RadioButtonRenderer))]
9-
public partial class RadioButton : Button
9+
public partial class RadioButton : Button, IElementConfiguration<RadioButton>
1010
{
11+
readonly Lazy<PlatformConfigurationRegistry<RadioButton>> _platformConfigurationRegistry;
12+
1113
static Dictionary<string, List<WeakReference<RadioButton>>> _groupNameToElements;
1214

1315
public const string IsCheckedVisualState = "IsChecked";
@@ -41,6 +43,16 @@ public ImageSource ButtonSource
4143
set { SetValue(ButtonSourceProperty, value); }
4244
}
4345

46+
public RadioButton()
47+
{
48+
_platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<RadioButton>>(() => new PlatformConfigurationRegistry<RadioButton>(this));
49+
}
50+
51+
public new IPlatformElementConfiguration<T, RadioButton> On<T>() where T : IConfigPlatform
52+
{
53+
return _platformConfigurationRegistry.Value.On<T>();
54+
}
55+
4456
protected internal override void ChangeVisualState()
4557
{
4658
if (IsEnabled && IsChecked)
@@ -170,4 +182,4 @@ static Element GetVisualRoot(Element element)
170182
return parent;
171183
}
172184
}
173-
}
185+
}

0 commit comments

Comments
 (0)