SnapPointsType enumeration

Applies to Windows and Windows Phone

Defines constants that specify how panning snap points are processed for gesture/manipulation input.

Syntax


public enum SnapPointsType

Attributes

[Version(0x06020000)]
[WebHostHidden()]

Members

The SnapPointsType enumeration has these members.

MemberValueDescription
None0

No snapping behavior. Only the manipulation influences the final location.

Optional1

Content stops at a snap point closest to where inertia would naturally stop along the direction of inertia, depending on how close the snap point is.

Mandatory2

Content always stops at the snap point closest to where inertia would naturally stop along the direction of inertia.

OptionalSingle3

Content stops at the next snap point, if the motion starts far from it.

MandatorySingle4

Content always stops at the snap point closest to the release point along the direction of inertia.

Remarks

For panning actions, there are often natural stopping places. Snap points provide a way to indicate where these places are. Then, when a user swipes, the manipulation result favors that natural point using behavior as expressed by a SnapPointsType value. The proximity determination is made by the Direct Manipulation subsystem that supports the manipulation handling for a XAML ScrollViewer. The Single variations factor in both the inertia and the release point.

Proximity points (Optional and OptionalSingle): When a user is going to naturally stop the manipulation in the proximity of a snap point, proximity points help the user land at the natural stopping place. Because the user has to land in proximity to the snap point to cause it to stop there, the user will sometimes have to perform another swipe to reach a snap point.

Mandatory snap points (Mandatory and MandatorySingle): In contrast to proximity, mandatory snap points ensure that the content is adjusted to always land on a snap point. Even if the user releases the manipulation halfway between two snap-points, it will always move to one of the snap points.

The SnapPointsType enumeration is used as a value for the ScrollViewer.HorizontalSnapPointsType and ScrollViewer.VerticalSnapPointsType properties.

To see the effects of snap points on ScrollViewer behavior yourself, get the XAML scrolling, panning and zooming sample. Run the sample on a touch device (not the simulator). Try out the SnapPointsType values when you view the "Panning with snap-points" example page of the sample.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

ScrollViewer
ScrollViewer.HorizontalSnapPointsType
ScrollViewer.VerticalSnapPointsType
XAML scrolling, panning and zooming sample

 

 

Show:
© 2014 Microsoft