|
@@ -199,6 +199,11 @@ namespace Avalonia.Input
|
|
|
/// </summary>
|
|
|
public static readonly RoutedEvent<TappedEventArgs> TappedEvent = Gestures.TappedEvent;
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Defines the <see cref="RightTapped"/> event.
|
|
|
+ /// </summary>
|
|
|
+ public static readonly RoutedEvent<TappedEventArgs> RightTappedEvent = Gestures.RightTappedEvent;
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Defines the <see cref="Holding"/> event.
|
|
|
/// </summary>
|
|
@@ -238,6 +243,11 @@ namespace Avalonia.Input
|
|
|
PointerCaptureLostEvent.AddClassHandler<InputElement>((x, e) => x.OnPointerCaptureLost(e));
|
|
|
PointerWheelChangedEvent.AddClassHandler<InputElement>((x, e) => x.OnPointerWheelChanged(e));
|
|
|
|
|
|
+ TappedEvent.AddClassHandler<InputElement>((x, e) => x.OnTapped(e));
|
|
|
+ RightTappedEvent.AddClassHandler<InputElement>((x, e) => x.OnRightTapped(e));
|
|
|
+ DoubleTappedEvent.AddClassHandler<InputElement>((x, e) => x.OnDoubleTapped(e));
|
|
|
+ HoldingEvent.AddClassHandler<InputElement>((x, e) => x.OnHolding(e));
|
|
|
+
|
|
|
// Gesture only handlers
|
|
|
PointerMovedEvent.AddClassHandler<InputElement>((x, e) => x.OnGesturePointerMoved(e), handledEventsToo: true);
|
|
|
PointerPressedEvent.AddClassHandler<InputElement>((x, e) => x.OnGesturePointerPressed(e), handledEventsToo: true);
|
|
@@ -399,6 +409,15 @@ namespace Avalonia.Input
|
|
|
remove { RemoveHandler(TappedEvent, value); }
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Occurs when a right tap gesture occurs on the control.
|
|
|
+ /// </summary>
|
|
|
+ public event EventHandler<TappedEventArgs>? RightTapped
|
|
|
+ {
|
|
|
+ add { AddHandler(RightTappedEvent, value); }
|
|
|
+ remove { RemoveHandler(RightTappedEvent, value); }
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Occurs when a hold gesture occurs on the control.
|
|
|
/// </summary>
|
|
@@ -746,6 +765,46 @@ namespace Avalonia.Input
|
|
|
{
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Invoked when an unhandled <see cref="TappedEvent"/> reaches an element in its
|
|
|
+ /// route that is derived from this class. Implement this method to add class handling
|
|
|
+ /// for this event.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="e">Data about the event.</param>
|
|
|
+ protected virtual void OnTapped(TappedEventArgs e)
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Invoked when an unhandled <see cref="RightTappedEvent"/> reaches an element in its
|
|
|
+ /// route that is derived from this class. Implement this method to add class handling
|
|
|
+ /// for this event.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="e">Data about the event.</param>
|
|
|
+ protected virtual void OnRightTapped(TappedEventArgs e)
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Invoked when an unhandled <see cref="DoubleTappedEvent"/> reaches an element in its
|
|
|
+ /// route that is derived from this class. Implement this method to add class handling
|
|
|
+ /// for this event.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="e">Data about the event.</param>
|
|
|
+ protected virtual void OnDoubleTapped(TappedEventArgs e)
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Invoked when an unhandled <see cref="HoldingEvent"/> reaches an element in its
|
|
|
+ /// route that is derived from this class. Implement this method to add class handling
|
|
|
+ /// for this event.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="e">Data about the event.</param>
|
|
|
+ protected virtual void OnHolding(HoldingRoutedEventArgs e)
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
|
|
|
{
|
|
|
base.OnPropertyChanged(change);
|