diff --git a/src/Avalonia.Base/Input/Gestures.cs b/src/Avalonia.Base/Input/Gestures.cs
index b4d5feaf3b..54e61d89b2 100644
--- a/src/Avalonia.Base/Input/Gestures.cs
+++ b/src/Avalonia.Base/Input/Gestures.cs
@@ -1,6 +1,8 @@
using System;
+using System.Threading;
using Avalonia.Interactivity;
using Avalonia.Platform;
+using Avalonia.Threading;
using Avalonia.VisualTree;
namespace Avalonia.Input
@@ -8,6 +10,21 @@ namespace Avalonia.Input
public static class Gestures
{
private static bool s_isDoubleTapped = false;
+ private static bool s_isHolding;
+ private static CancellationTokenSource? s_holdCancellationToken;
+
+ ///
+ /// Defines the IsHoldingEnabled attached property.
+ ///
+ public static readonly AttachedProperty IsHoldingEnabledProperty =
+ AvaloniaProperty.RegisterAttached("IsHoldingEnabled", typeof(Gestures), true);
+
+ ///
+ /// Defines the IsHoldWithMouseEnabled attached property.
+ ///
+ public static readonly AttachedProperty IsHoldWithMouseEnabledProperty =
+ AvaloniaProperty.RegisterAttached("IsHoldWithMouseEnabled", typeof(Gestures), false);
+
public static readonly RoutedEvent TappedEvent = RoutedEvent.Register(
"Tapped",
RoutingStrategies.Bubble,
@@ -45,6 +62,7 @@ namespace Avalonia.Input
private static readonly WeakReference