diff options
author | Marcus Lum <marcusl@gmail.com> | 2016-08-30 13:37:07 -0400 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-08-30 10:37:07 -0700 |
commit | 61f34d113c9f6941194a6ed3101f54158de722a3 (patch) | |
tree | b6211a4e1a4dba6ec40aad3823a795387e851815 /Xamarin.Forms.Platform.Android/Renderers/SwitchRenderer.cs | |
parent | 5b85aafcd671f5e8745cf52339c20378f91cb748 (diff) | |
download | xamarin-forms-61f34d113c9f6941194a6ed3101f54158de722a3.tar.gz xamarin-forms-61f34d113c9f6941194a6ed3101f54158de722a3.tar.bz2 xamarin-forms-61f34d113c9f6941194a6ed3101f54158de722a3.zip |
Allow Custom Android MapRenderers to override the default MapView options (#285)
* Allow Custom Android MapRenderers to override the default MapView options
* Larger effort to use CreateNativeControl () everywhere instead of just in the Android AppCompat renderers.
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Renderers/SwitchRenderer.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Android/Renderers/SwitchRenderer.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.Android/Renderers/SwitchRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/SwitchRenderer.cs index 39916b58..2c0b0144 100644 --- a/Xamarin.Forms.Platform.Android/Renderers/SwitchRenderer.cs +++ b/Xamarin.Forms.Platform.Android/Renderers/SwitchRenderer.cs @@ -47,6 +47,11 @@ namespace Xamarin.Forms.Platform.Android base.Dispose(disposing); } + protected override ASwitch CreateNativeControl() + { + return new ASwitch(Context); + } + protected override void OnElementChanged(ElementChangedEventArgs<Switch> e) { base.OnElementChanged(e); @@ -58,7 +63,7 @@ namespace Xamarin.Forms.Platform.Android { if (Control == null) { - var aswitch = new ASwitch(Context); + var aswitch = CreateNativeControl(); aswitch.SetOnCheckedChangeListener(this); SetNativeControl(aswitch); } |