This repository was archived by the owner on May 1, 2024. It is now read-only.
File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 6
6
namespace Xamarin . Forms
7
7
{
8
8
[ RenderWith ( typeof ( _RadioButtonRenderer ) ) ]
9
- public partial class RadioButton : Button
9
+ public partial class RadioButton : Button , IElementConfiguration < RadioButton >
10
10
{
11
+ readonly Lazy < PlatformConfigurationRegistry < RadioButton > > _platformConfigurationRegistry ;
12
+
11
13
static Dictionary < string , List < WeakReference < RadioButton > > > _groupNameToElements ;
12
14
13
15
public const string IsCheckedVisualState = "IsChecked" ;
@@ -41,6 +43,16 @@ public ImageSource ButtonSource
41
43
set { SetValue ( ButtonSourceProperty , value ) ; }
42
44
}
43
45
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
+
44
56
protected internal override void ChangeVisualState ( )
45
57
{
46
58
if ( IsEnabled && IsChecked )
@@ -170,4 +182,4 @@ static Element GetVisualRoot(Element element)
170
182
return parent ;
171
183
}
172
184
}
173
- }
185
+ }
You can’t perform that action at this time.
0 commit comments