summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSungHyun Min <shyun.min@samsung.com>2017-08-25 05:24:31 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-10-23 04:34:41 (GMT)
commitd7f6fc894a6837fd032b76d9aa38b7a7b2a02c17 (patch)
treefb327285e2896c2a7fd1ca2b8f1fb7e3a57d749d
parent547d4ef74a9ed307730f87bb13ef409abd77deb7 (diff)
downloadxamarin-forms-d7f6fc894a6837fd032b76d9aa38b7a7b2a02c17.zip
xamarin-forms-d7f6fc894a6837fd032b76d9aa38b7a7b2a02c17.tar.gz
xamarin-forms-d7f6fc894a6837fd032b76d9aa38b7a7b2a02c17.tar.bz2
Fix the issue that gesture ignores IsEnable=false on Element
TASK=TCAPI-2623 Change-Id: I8a5f223348b0028953ee22c878d3b0f94baad631
-rw-r--r--Xamarin.Forms.Platform.Tizen/GestureDetector.cs17
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/ViewRenderer.cs16
2 files changed, 33 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/GestureDetector.cs b/Xamarin.Forms.Platform.Tizen/GestureDetector.cs
index 720b23f..6bf15fa 100644
--- a/Xamarin.Forms.Platform.Tizen/GestureDetector.cs
+++ b/Xamarin.Forms.Platform.Tizen/GestureDetector.cs
@@ -22,6 +22,22 @@ namespace Xamarin.Forms.Platform.Tizen
View View => _renderer.Element as View;
+ public bool IsEnabled
+ {
+ get
+ {
+ if (_gestureLayer != null)
+ return _gestureLayer.IsEnabled;
+
+ return false;
+ }
+ set
+ {
+ if (_gestureLayer != null)
+ _gestureLayer.IsEnabled = value;
+ }
+ }
+
public GestureDetector(IVisualElementRenderer renderer)
{
_renderer = renderer;
@@ -59,6 +75,7 @@ namespace Xamarin.Forms.Platform.Tizen
_gestureLayer = null;
Clear();
};
+ _gestureLayer.IsEnabled = _renderer.Element.IsEnabled;
}
void AddGestures(IEnumerable<IGestureRecognizer> recognizers)
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ViewRenderer.cs
index c086f93..4f98124 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/ViewRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/ViewRenderer.cs
@@ -1,3 +1,4 @@
+using System.ComponentModel;
using ElmSharp;
namespace Xamarin.Forms.Platform.Tizen
@@ -34,6 +35,16 @@ namespace Xamarin.Forms.Platform.Tizen
}
}
+ protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ base.OnElementPropertyChanged(sender, e);
+
+ if (e.PropertyName == VisualElement.IsEnabledProperty.PropertyName)
+ {
+ UpdateIsEnabled();
+ }
+ }
+
/// <summary>
/// Native control associated with this renderer.
/// </summary>
@@ -44,5 +55,10 @@ namespace Xamarin.Forms.Platform.Tizen
return (TNativeView)NativeView;
}
}
+
+ void UpdateIsEnabled()
+ {
+ _gestureDetector.IsEnabled = Element.IsEnabled;
+ }
}
} \ No newline at end of file