2016-03-22 23:02:25 +03:00
|
|
|
using System;
|
2017-04-11 21:02:06 +03:00
|
|
|
using System.ComponentModel;
|
2017-03-07 22:56:24 +03:00
|
|
|
using Xamarin.Forms.Internals;
|
2016-03-22 23:02:25 +03:00
|
|
|
|
|
|
|
namespace Xamarin.Forms
|
|
|
|
{
|
|
|
|
public class PanGestureRecognizer : GestureRecognizer, IPanGestureController
|
|
|
|
{
|
|
|
|
public static readonly BindableProperty TouchPointsProperty = BindableProperty.Create("TouchPoints", typeof(int), typeof(PanGestureRecognizer), 1);
|
|
|
|
|
|
|
|
public int TouchPoints
|
|
|
|
{
|
|
|
|
get { return (int)GetValue(TouchPointsProperty); }
|
|
|
|
set { SetValue(TouchPointsProperty, value); }
|
|
|
|
}
|
|
|
|
|
2017-04-11 21:02:06 +03:00
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
|
|
public void SendPan(Element sender, double totalX, double totalY, int gestureId)
|
2016-03-22 23:02:25 +03:00
|
|
|
{
|
|
|
|
PanUpdated?.Invoke(sender, new PanUpdatedEventArgs(GestureStatus.Running, gestureId, totalX, totalY));
|
|
|
|
}
|
|
|
|
|
2017-04-11 21:02:06 +03:00
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
|
|
public void SendPanCanceled(Element sender, int gestureId)
|
2016-03-22 23:02:25 +03:00
|
|
|
{
|
|
|
|
PanUpdated?.Invoke(sender, new PanUpdatedEventArgs(GestureStatus.Canceled, gestureId));
|
|
|
|
}
|
|
|
|
|
2017-04-11 21:02:06 +03:00
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
|
|
public void SendPanCompleted(Element sender, int gestureId)
|
2016-03-22 23:02:25 +03:00
|
|
|
{
|
|
|
|
PanUpdated?.Invoke(sender, new PanUpdatedEventArgs(GestureStatus.Completed, gestureId));
|
|
|
|
}
|
|
|
|
|
2017-04-11 21:02:06 +03:00
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
|
|
public void SendPanStarted(Element sender, int gestureId)
|
2016-03-22 23:02:25 +03:00
|
|
|
{
|
|
|
|
PanUpdated?.Invoke(sender, new PanUpdatedEventArgs(GestureStatus.Started, gestureId));
|
|
|
|
}
|
|
|
|
|
|
|
|
public event EventHandler<PanUpdatedEventArgs> PanUpdated;
|
|
|
|
}
|
|
|
|
}
|