summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-07-10 15:40:00 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-10-23 13:34:38 +0900
commita605093b48e4199f2f6aea6d8884c2315256d049 (patch)
tree3865aeacd83694be603b4c0cd2028aa8dd0a575e /Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs
parenta66908ac3d44b864be17a8a6e746021afe8ce86d (diff)
downloadxamarin-forms-a605093b48e4199f2f6aea6d8884c2315256d049.tar.gz
xamarin-forms-a605093b48e4199f2f6aea6d8884c2315256d049.tar.bz2
xamarin-forms-a605093b48e4199f2f6aea6d8884c2315256d049.zip
Move registration of property handles to static constructors
Property handlers are registered once per class instead of once per instance. Solves the issue with UpdateAllProperties and Distinct. Change-Id: I41b3f6c0a055c7aa76300bf7a55683b0b25a21fd
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs')
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs
index 5c6814ab..5a748727 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/SwitchRenderer.cs
@@ -8,9 +8,9 @@ namespace Xamarin.Forms.Platform.Tizen
{
public class SwitchRenderer : ViewRenderer<Switch, Check>
{
- public SwitchRenderer()
+ static SwitchRenderer()
{
- RegisterPropertyHandler(Switch.IsToggledProperty, HandleToggled);
+ RegisterPropertyHandler(Switch.IsToggledProperty, (r) => (r as SwitchRenderer).HandleToggled());
}
protected override void OnElementChanged(ElementChangedEventArgs<Switch> e)