Helper class for triggering gesture recognizers in headless tests. This class creates persistent Pointer instances that can be tracked by gesture recognizers. Uses reflection to access internal Avalonia APIs for proper gesture recognizer integration. Based on Avalonia's TouchTestHelper pattern.
public class GestureRecognizerTestHelper
CRITICAL: When testing gesture events (Pinch, Scroll, etc.),
handlers must be registered BEFORE calling window.Show().
// CORRECT pattern:
var control = new MyControl();
control.AddHandler(InputElement.PinchEvent, handler); // Register FIRST
var window = new Window { Content = control };
window.Show(); // Show AFTER
// WRONG pattern (events won't fire):
var window = new Window ;
window.Show(); // Show FIRST
control.AddHandler(InputElement.PinchEvent, handler); // Too late!
kind:method, kind:property, kind:ctor. Press Esc to clear.GestureRecognizerTestHelper()Creates a new gesture recognizer test helper with a touch pointer.GestureRecognizerTestHelper(PointerType)Creates a new gesture recognizer test helper with a specified pointer type.CapturedGets the currently captured input element.CapturedGestureRecognizerGets the currently captured gesture recognizer (via reflection).PointerGets the pointer associated with this helper.Cancel()Cancels the current gesture, releasing the pointer capture.Down(Interactive, Interactive, Point, KeyModifiers)Simulates a pointer down event at the specified position with a specific source.Down(Interactive, Point, KeyModifiers)Simulates a pointer down event at the specified position.Drag(Interactive, Point, Point, Int32)Performs a drag gesture from one point to another.Move(Interactive, Interactive, Point, KeyModifiers)Simulates a pointer move event to the specified position with a specific source.Move(Interactive, Point, KeyModifiers)Simulates a pointer move event to the specified position.Tap(Interactive, Interactive, Point, KeyModifiers)Simulates a tap (down and up) at the specified position with a specific source.Tap(Interactive, Point, KeyModifiers)Simulates a tap (down and up) at the specified position.Up(Interactive, Interactive, Point, KeyModifiers)Simulates a pointer up event with a specific source.Up(Interactive, Point, KeyModifiers)Simulates a pointer up event.