Skip to main content

SwipeGestureRecognizer Class

Definition

Assembly:Avalonia.Base
Package:Avalonia

A gesture recognizer that detects swipe gestures and raises Avalonia.Input.InputElement.SwipeGestureEvent on the target element when a swipe is confirmed.

public class SwipeGestureRecognizer

Inheritance: object -> AvaloniaObject -> Animatable -> StyledElement -> GestureRecognizer -> SwipeGestureRecognizer

Constructors

NameDescription
SwipeGestureRecognizerNo summary available.

SwipeGestureRecognizer Constructor

public SwipeGestureRecognizer()

Methods

NameDescription
ApplyStylingApplies styling to the control if the control is initialized and styling is not already applied. Inherited from StyledElement.
BeginInitInherited from StyledElement.
EndInitInherited from StyledElement.
TryGetResourceInherited from StyledElement.
Bind (8 overloads)Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject.
CheckAccessReturns a value indicating whether the current thread is the UI thread. Inherited from AvaloniaObject.
ClearValue (4 overloads)Clears a Avalonia.AvaloniaProperty's local value. Inherited from AvaloniaObject.
CoerceValueCoerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject.
EqualsCompares two objects using reference equality. Inherited from AvaloniaObject.
GetBaseValueInherited from AvaloniaObject.
GetHashCodeGets the hash code for the object. Inherited from AvaloniaObject.
GetValue (3 overloads)Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject.
IsAnimatingChecks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject.
IsSetChecks whether a Avalonia.AvaloniaProperty is set on this object. Inherited from AvaloniaObject.
SetCurrentValue (2 overloads)Sets the value of a dependency property without changing its value source. Inherited from AvaloniaObject.
SetValue (3 overloads)Sets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject.
VerifyAccessChecks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject.

Properties

NameDescription
CrossAxisCancelThresholdGets or sets the maximum cross-axis drift in pixels allowed before the gesture is cancelled. Default is 8px.
EdgeSizeGets or sets the leading-edge start zone in pixels. When greater than zero, tracking only begins if the pointer is within this distance of the leading edge. Default is 0 (full area).
IsEnabledGets or sets a value indicating whether the recognizer responds to pointer events. Setting this to false is a lightweight alternative to removing the recognizer from the collection. Default is true.
ThresholdGets or sets the minimum distance in pixels the pointer must travel before a swipe is recognized. Default is 30px.
ActualThemeVariantGets the UI theme that is currently used by the element, which might be different than the RequestedThemeVariantProperty. Inherited from StyledElement.
ClassesGets or sets the styled element's classes. Inherited from StyledElement.
DataContextGets or sets the control's data context. Inherited from StyledElement.
IsInitializedGets a value that indicates whether the element has finished initialization. Inherited from StyledElement.
NameGets or sets the name of the styled element. Inherited from StyledElement.
ParentGets the styled element's logical parent. Inherited from StyledElement.
ResourcesGets or sets the styled element's resource dictionary. Inherited from StyledElement.
StyleKeyGets the type by which the element is styled. Inherited from StyledElement.
StylesGets the styles for the styled element. Inherited from StyledElement.
TemplatedParentGets the styled element whose lookless template this styled element is part of. Inherited from StyledElement.
ThemeGets or sets the theme to be applied to the element. Inherited from StyledElement.
TransitionsGets or sets the property transitions for the control. Inherited from Animatable.
DispatcherReturns the Avalonia.AvaloniaObject.Dispatcher that this Avalonia.AvaloniaObject is associated with. Inherited from AvaloniaObject.
ItemInherited from AvaloniaObject.

CrossAxisCancelThreshold Property

Gets or sets the maximum cross-axis drift in pixels allowed before the gesture is cancelled. Default is 8px.

public double CrossAxisCancelThreshold { get; set; }

EdgeSize Property

Gets or sets the leading-edge start zone in pixels. When greater than zero, tracking only begins if the pointer is within this distance of the leading edge. Default is 0 (full area).

public double EdgeSize { get; set; }

IsEnabled Property

Gets or sets a value indicating whether the recognizer responds to pointer events. Setting this to false is a lightweight alternative to removing the recognizer from the collection. Default is true.

public bool IsEnabled { get; set; }

Threshold Property

Gets or sets the minimum distance in pixels the pointer must travel before a swipe is recognized. Default is 30px.

public double Threshold { get; set; }

Fields

NameDescription
CrossAxisCancelThresholdPropertyDefines the Avalonia.Input.GestureRecognizers.SwipeGestureRecognizer.CrossAxisCancelThreshold property.
EdgeSizePropertyDefines the Avalonia.Input.GestureRecognizers.SwipeGestureRecognizer.EdgeSize property. Leading-edge start zone in px. 0 (default) = full area. When > 0, only starts tracking if the pointer is within this many px of the leading edge (LTR: left; RTL: right).
IsEnabledPropertyDefines the Avalonia.Input.GestureRecognizers.SwipeGestureRecognizer.IsEnabled property. When false, the recognizer ignores all pointer events. Lets callers toggle the recognizer at runtime without needing to remove it from the collection (GestureRecognizerCollection has Add but no Remove). Default: true.
ThresholdPropertyDefines the Avalonia.Input.GestureRecognizers.SwipeGestureRecognizer.Threshold property.
DataContextPropertyDefines the Avalonia.StyledElement.DataContext property. Inherited from StyledElement.
NamePropertyDefines the Avalonia.StyledElement.Name property. Inherited from StyledElement.
ParentPropertyDefines the Avalonia.StyledElement.Parent property. Inherited from StyledElement.
TemplatedParentPropertyDefines the Avalonia.StyledElement.TemplatedParent property. Inherited from StyledElement.
ThemePropertyDefines the Avalonia.StyledElement.Theme property. Inherited from StyledElement.
TransitionsPropertyDefines the Avalonia.Animation.Animatable.Transitions property. Inherited from Animatable.

CrossAxisCancelThresholdProperty Field

Defines the Avalonia.Input.GestureRecognizers.SwipeGestureRecognizer.CrossAxisCancelThreshold property.

public Avalonia.StyledProperty<TValue><double> CrossAxisCancelThresholdProperty

EdgeSizeProperty Field

Defines the Avalonia.Input.GestureRecognizers.SwipeGestureRecognizer.EdgeSize property. Leading-edge start zone in px. 0 (default) = full area. When > 0, only starts tracking if the pointer is within this many px of the leading edge (LTR: left; RTL: right).

public Avalonia.StyledProperty<TValue><double> EdgeSizeProperty

IsEnabledProperty Field

Defines the Avalonia.Input.GestureRecognizers.SwipeGestureRecognizer.IsEnabled property. When false, the recognizer ignores all pointer events. Lets callers toggle the recognizer at runtime without needing to remove it from the collection (GestureRecognizerCollection has Add but no Remove). Default: true.

public Avalonia.StyledProperty<TValue><bool> IsEnabledProperty

ThresholdProperty Field

Defines the Avalonia.Input.GestureRecognizers.SwipeGestureRecognizer.Threshold property.

public Avalonia.StyledProperty<TValue><double> ThresholdProperty

Events

NameDescription
ActualThemeVariantChangedRaised when the theme variant is changed on the element or an ancestor of the element. Inherited from StyledElement.
AttachedToLogicalTreeRaised when the styled element is attached to a rooted logical tree. Inherited from StyledElement.
DataContextChangedOccurs when the Avalonia.StyledElement.DataContext property changes. Inherited from StyledElement.
DetachedFromLogicalTreeRaised when the styled element is detached from a rooted logical tree. Inherited from StyledElement.
InitializedOccurs when the styled element has finished initialization. Inherited from StyledElement.
ResourcesChangedOccurs when a resource in this styled element or a parent styled element has changed. Inherited from StyledElement.
PropertyChangedRaised when a Avalonia.AvaloniaProperty value changes on this object. Inherited from AvaloniaObject.