Skip to main content

PointerEventArgs Class

Definition

Namespace:Avalonia.Input
Assembly:Avalonia.Base
Package:Avalonia
public class PointerEventArgs

Constructors

NameDescription
PointerEventArgsNo summary available.

PointerEventArgs Constructor

public PointerEventArgs(Avalonia.Interactivity.RoutedEvent routedEvent, object source, Avalonia.Input.IPointer pointer, Avalonia.Visual rootVisual, Avalonia.Point rootVisualPosition, ulong timestamp, Avalonia.Input.PointerPointProperties properties, Avalonia.Input.KeyModifiers modifiers)

Parameters

routedEvent Avalonia.Interactivity.RoutedEvent

source object

pointer Avalonia.Input.IPointer

rootVisual Avalonia.Visual

rootVisualPosition Avalonia.Point

timestamp ulong

properties Avalonia.Input.PointerPointProperties

modifiers Avalonia.Input.KeyModifiers

Methods

NameDescription
GetCurrentPointReturns the PointerPoint associated with the current event
GetIntermediatePointsReturns the PointerPoint associated with the current event
GetPositionGets the pointer position relative to a control.
PreventGestureRecognitionPrevents this event from being handled by other gesture recognizers in the route

GetCurrentPoint Method

Returns the PointerPoint associated with the current event

public Avalonia.Input.PointerPoint GetCurrentPoint(Avalonia.Visual relativeTo)

Parameters

relativeTo Avalonia.Visual

The visual whose coordinate system to use. Pass null for toplevel coordinate system

Returns

Avalonia.Input.PointerPoint

GetIntermediatePoints Method

Returns the PointerPoint associated with the current event

public System.Collections.Generic.IReadOnlyList<Avalonia.Input.PointerPoint> GetIntermediatePoints(Avalonia.Visual relativeTo)

Parameters

relativeTo Avalonia.Visual

The visual which coordinate system to use. Pass null for toplevel coordinate system

Returns

System.Collections.Generic.IReadOnlyList<Avalonia.Input.PointerPoint>

GetPosition Method

Gets the pointer position relative to a control.

public Avalonia.Point GetPosition(Avalonia.Visual relativeTo)

Parameters

relativeTo Avalonia.Visual

The visual whose coordinate system to use. Pass null for toplevel coordinate system

Returns

Avalonia.Point

The pointer position in the control's coordinates.

PreventGestureRecognition Method

Prevents this event from being handled by other gesture recognizers in the route

public void PreventGestureRecognition()

Properties

NameDescription
KeyModifiersGets a value that indicates which key modifiers were active at the time that the pointer event was initiated.
PointerGets specific pointer generated by input device.
PropertiesGets the state the pointer device had when this event occurred.
TimestampGets the time when the input occurred.
HandledGets or sets a value indicating whether the routed event has already been handled. Inherited from RoutedEventArgs.
RouteGets or sets the routing strategy (direct, bubbling, or tunneling) of the routed event. Inherited from RoutedEventArgs.
RoutedEventGets or sets the routed event associated with these event args. Inherited from RoutedEventArgs.
SourceGets or sets the source object that raised the routed event. Inherited from RoutedEventArgs.

KeyModifiers Property

Gets a value that indicates which key modifiers were active at the time that the pointer event was initiated.

public Avalonia.Input.KeyModifiers KeyModifiers { get; set; }

Pointer Property

Gets specific pointer generated by input device.

public Avalonia.Input.IPointer Pointer { get; set; }

Properties Property

Gets the state the pointer device had when this event occurred.

public Avalonia.Input.PointerPointProperties Properties { get; set; }

Timestamp Property

Gets the time when the input occurred.

public ulong Timestamp { get; set; }