summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen/NativeBindingService.cs
diff options
context:
space:
mode:
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>2017-01-26 13:14:55 +0100
committerKangho Hur <kangho.hur@samsung.com>2017-03-24 13:19:01 +0900
commit0e298701922b826058d9be3bf7567797d5210fa3 (patch)
treeca28cfe40fdb4799b788cce5f2d1bc819b15c58d /Xamarin.Forms.Platform.Tizen/NativeBindingService.cs
parent258d67fd681305b8eab03bcaa61fcf4da4eaebc0 (diff)
downloadxamarin-forms-0e298701922b826058d9be3bf7567797d5210fa3.tar.gz
xamarin-forms-0e298701922b826058d9be3bf7567797d5210fa3.tar.bz2
xamarin-forms-0e298701922b826058d9be3bf7567797d5210fa3.zip
Add support for NativeViews specified in XAML
See: https://developer.xamarin.com/guides/xamarin-forms/user-interface/native-views/ Change-Id: I0a4315cccdaa208585f417db4f91240555a64a47 Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/NativeBindingService.cs')
-rw-r--r--Xamarin.Forms.Platform.Tizen/NativeBindingService.cs38
1 files changed, 38 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/NativeBindingService.cs b/Xamarin.Forms.Platform.Tizen/NativeBindingService.cs
new file mode 100644
index 00000000..945726eb
--- /dev/null
+++ b/Xamarin.Forms.Platform.Tizen/NativeBindingService.cs
@@ -0,0 +1,38 @@
+´╗┐using System;
+
+using EObject = ElmSharp.EvasObject;
+
+namespace Xamarin.Forms.Platform.Tizen
+{
+ class NativeBindingService : Xaml.INativeBindingService
+ {
+ public bool TrySetBinding(object target, string propertyName, BindingBase binding)
+ {
+ var view = target as EObject;
+ if (view == null)
+ return false;
+ if (target.GetType().GetProperty(propertyName)?.GetMethod == null)
+ return false;
+ view.SetBinding(propertyName, binding);
+ return true;
+ }
+
+ public bool TrySetBinding(object target, BindableProperty property, BindingBase binding)
+ {
+ var view = target as EObject;
+ if (view == null)
+ return false;
+ view.SetBinding(property, binding);
+ return true;
+ }
+
+ public bool TrySetValue(object target, BindableProperty property, object value)
+ {
+ var view = target as EObject;
+ if (view == null)
+ return false;
+ view.SetValue(property, value);
+ return true;
+ }
+ }
+}