Table of Contents

Interface IScrollSnapPointsInfo

Namespace
Avalonia.Controls.Primitives
Assembly
Avalonia.Controls.dll

Describes snap point behavior for objects that contain and present items.

public interface IScrollSnapPointsInfo

Properties

AreHorizontalSnapPointsRegular

Gets or sets a value that indicates whether the horizontal snap points for the container are equidistant from each other.

bool AreHorizontalSnapPointsRegular { get; set; }

Property Value

bool

AreVerticalSnapPointsRegular

Gets or sets a value that indicates whether the vertical snap points for the container are equidistant from each other.

bool AreVerticalSnapPointsRegular { get; set; }

Property Value

bool

Methods

GetIrregularSnapPoints(Orientation, SnapPointsAlignment)

Returns the set of distances between irregular snap points for a specified orientation and alignment.

IReadOnlyList<double> GetIrregularSnapPoints(Orientation orientation, SnapPointsAlignment snapPointsAlignment)

Parameters

orientation Orientation

The orientation for the desired snap point set.

snapPointsAlignment SnapPointsAlignment

The alignment to use when applying the snap points.

Returns

IReadOnlyList<double>

The read-only collection of snap point distances. Returns an empty collection when no snap points are present.

GetRegularSnapPoints(Orientation, SnapPointsAlignment, out double)

Gets the distance between regular snap points for a specified orientation and alignment.

double GetRegularSnapPoints(Orientation orientation, SnapPointsAlignment snapPointsAlignment, out double offset)

Parameters

orientation Orientation

The orientation for the desired snap point set.

snapPointsAlignment SnapPointsAlignment

The alignment to use when applying the snap points.

offset double

Out parameter. The offset of the first snap point.

Returns

double

The distance between the equidistant snap points. Returns 0 when no snap points are present.

Events

HorizontalSnapPointsChanged

Occurs when the measurements for horizontal snap points change.

event EventHandler<RoutedEventArgs> HorizontalSnapPointsChanged

Event Type

EventHandler<RoutedEventArgs>

VerticalSnapPointsChanged

Occurs when the measurements for vertical snap points change.

event EventHandler<RoutedEventArgs> VerticalSnapPointsChanged

Event Type

EventHandler<RoutedEventArgs>