maui-linux/Xamarin.Forms.Core/PanGestureRecognizer.cs

38 строки
1.2 KiB
C#

using System;
using Xamarin.Forms.Internals;
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); }
}
void IPanGestureController.SendPan(Element sender, double totalX, double totalY, int gestureId)
{
PanUpdated?.Invoke(sender, new PanUpdatedEventArgs(GestureStatus.Running, gestureId, totalX, totalY));
}
void IPanGestureController.SendPanCanceled(Element sender, int gestureId)
{
PanUpdated?.Invoke(sender, new PanUpdatedEventArgs(GestureStatus.Canceled, gestureId));
}
void IPanGestureController.SendPanCompleted(Element sender, int gestureId)
{
PanUpdated?.Invoke(sender, new PanUpdatedEventArgs(GestureStatus.Completed, gestureId));
}
void IPanGestureController.SendPanStarted(Element sender, int gestureId)
{
PanUpdated?.Invoke(sender, new PanUpdatedEventArgs(GestureStatus.Started, gestureId));
}
public event EventHandler<PanUpdatedEventArgs> PanUpdated;
}
}