summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen/PanGestureHandler.cs
diff options
context:
space:
mode:
authorSungHyun Min <shyun.min@samsung.com>2017-02-22 10:49:54 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-10-23 04:34:30 (GMT)
commita6a7459ebdac9a907928675b2a80ec33202fba5a (patch)
tree377572ffcc2a754dd38aa730f75569c0c0509cab /Xamarin.Forms.Platform.Tizen/PanGestureHandler.cs
parent884625d1be0e04f16bad7c8b776a1d1066cf31f2 (diff)
downloadxamarin-forms-a6a7459ebdac9a907928675b2a80ec33202fba5a.zip
xamarin-forms-a6a7459ebdac9a907928675b2a80ec33202fba5a.tar.gz
xamarin-forms-a6a7459ebdac9a907928675b2a80ec33202fba5a.tar.bz2
Refactoring GestureHandler for extension
- Design : http://suprem.sec.samsung.net/confluence/display/SPTDTLC/Refactoring+GestureHandler Change-Id: I1cbcf830b4b1076c227b0ea641508198c7cb2102 Signed-off-by: SungHyun Min <shyun.min@samsung.com>
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/PanGestureHandler.cs')
-rw-r--r--Xamarin.Forms.Platform.Tizen/PanGestureHandler.cs47
1 files changed, 47 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/PanGestureHandler.cs b/Xamarin.Forms.Platform.Tizen/PanGestureHandler.cs
new file mode 100644
index 0000000..ec1e6de
--- /dev/null
+++ b/Xamarin.Forms.Platform.Tizen/PanGestureHandler.cs
@@ -0,0 +1,47 @@
+using System;
+using System.ComponentModel;
+using ElmSharp;
+
+namespace Xamarin.Forms.Platform.Tizen
+{
+ public class PanGestureHandler : GestureHandler
+ {
+ int _currentPanGestureId;
+
+ public PanGestureHandler(IGestureRecognizer recognizer) : base(recognizer)
+ {
+ }
+
+ public override GestureLayer.GestureType Type
+ {
+ get
+ {
+ return GestureLayer.GestureType.Momentum;
+ }
+ }
+
+ public override event PropertyChangedEventHandler PropertyChanged;
+
+ protected override void OnStarted(View sender, object data)
+ {
+ _currentPanGestureId++;
+ (Recognizer as IPanGestureController)?.SendPanStarted(sender, _currentPanGestureId);
+ }
+
+ protected override void OnMoved(View sender, object data)
+ {
+ var lineData = (GestureLayer.MomentumData)data;
+ (Recognizer as IPanGestureController)?.SendPan(sender, lineData.X2 - lineData.X1, lineData.Y2 - lineData.Y1, _currentPanGestureId);
+ }
+
+ protected override void OnCompleted(View sender, object data)
+ {
+ (Recognizer as IPanGestureController)?.SendPanCompleted(sender, _currentPanGestureId);
+ }
+
+ protected override void OnCanceled(View sender, object data)
+ {
+ (Recognizer as IPanGestureController)?.SendPanCanceled(sender, _currentPanGestureId);
+ }
+ }
+} \ No newline at end of file