Udostępnij za pośrednictwem


SnapPointsType Enum

Definition

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

public enum class SnapPointsType
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
enum class SnapPointsType
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum SnapPointsType
Public Enum SnapPointsType
Inheritance
SnapPointsType
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Fields

Name Value Description
None 0

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

Optional 1

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.

Mandatory 2

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

OptionalSingle 3

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

MandatorySingle 4

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.

Applies to

See also