summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen/NativeBindingService.cs
diff options
context:
space:
mode:
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;
+ }
+ }
+}