Comprehensive gesture simulator for headless testing of Avalonia controls. Provides methods to simulate all Avalonia gesture events including tap, double-tap, right-tap, holding, pinch, scroll, pull-to-refresh, and touchpad gestures.
public class GestureSimulator
Note: Some gesture event args have internal constructors in Avalonia. For these cases, we use reflection or alternative approaches. TappedEventArgs requires a PointerEventArgs which we create internally. ScrollGestureInertiaStartingEventArgs has an internal constructor and cannot be directly instantiated from user code - scroll sequences work without inertia events.
kind:method, kind:property, kind:ctor. Press Esc to clear.GestureSimulator()Creates a new gesture simulator.TimestampGets the current timestamp.AdvanceTime(Int32)Advances the internal timestamp by the specified number of milliseconds.DoubleTap(Interactive, Point, PointerType, KeyModifiers)Simulates a DoubleTap gesture event.DoubleTapZoom(Interactive, Point, Double, Int32)Simulates a double-tap-and-zoom gesture (common iOS/Android pattern).Flick(Interactive, SwipeDirection, Double, Double)Simulates a flick/fling gesture (fast swipe with inertia).GetNextGestureId()Generates a unique gesture ID.Hold(Interactive, Point, Int32, PointerType)Simulates a complete holding gesture sequence (started -> wait -> completed).HoldingCancelled(Interactive, Point, PointerType)Simulates a Holding gesture cancelled event.HoldingCompleted(Interactive, Point, PointerType)Simulates a Holding gesture completed event.HoldingStarted(Interactive, Point, PointerType)Simulates a Holding gesture started event (press and hold).Pinch(Interactive, Double, Point, Double, Double)Simulates a Pinch gesture event.PinchEnded(Interactive)Simulates a Pinch gesture ended event.PinchRotate(Interactive, Point, Double, Double, Int32)Simulates a pinch rotation gesture.PinchZoom(Interactive, Point, Double, Double, Int32, Double, Double)Simulates a complete pinch zoom gesture sequence.Pull(Interactive, Vector, PullDirection, Nullable<Int32>)Simulates a Pull gesture event (pull-to-refresh style).PullEnded(Interactive, Int32, PullDirection)Simulates a Pull gesture ended event.PullToRefresh(Interactive, PullDirection, Double, Int32)Simulates a complete pull-to-refresh gesture sequence.Reset()Resets the simulator to its initial state.RightTap(Interactive, Point, PointerType, KeyModifiers)Simulates a RightTap gesture event (context menu trigger).Scroll(Interactive, Vector, Nullable<Int32>)Simulates a Scroll gesture event.ScrollEnded(Interactive, Int32)Simulates a Scroll gesture ended event.ScrollInertiaStarting(Interactive, Int32, Vector)Simulates a Scroll gesture inertia starting event. Note: ScrollGestureInertiaStartingEventArgs has an internal constructor in Avalonia. This method uses reflection to create the event args.ScrollSequence(Interactive, Vector, Int32, Boolean, Nullable<Vector>)Simulates a complete scroll gesture sequence with optional inertia.Tap(Interactive, Point, PointerType, KeyModifiers)Simulates a Tap gesture event. Uses RoutedEventArgs approach since TappedEventArgs requires internal PointerEventArgs.TapAndHold(Interactive, Point, Int32, PointerType)Simulates a tap-and-hold gesture (tap followed by hold).ThreeFingerSwipe(Interactive, Point, SwipeDirection, Double)Simulates a three-finger swipe gesture (common for navigation).TouchpadMagnify(Interactive, Vector, Point, KeyModifiers)Simulates a touchpad magnify gesture (macOS trackpad pinch-to-zoom).TouchpadMagnifySequence(Interactive, Point, Double, Int32, KeyModifiers)Simulates a complete touchpad magnify sequence (zoom in or out).TouchpadRotate(Interactive, Double, Point, KeyModifiers)Simulates a touchpad rotate gesture (macOS trackpad rotation).TouchpadRotateSequence(Interactive, Point, Double, Int32, KeyModifiers)Simulates a complete touchpad rotation sequence.TouchpadSwipe(Interactive, Vector, Point, KeyModifiers)Simulates a touchpad swipe gesture (macOS trackpad multi-finger swipe).TouchpadSwipeSequence(Interactive, Point, SwipeDirection, Double, Int32, KeyModifiers)Simulates a complete touchpad swipe sequence.