Open
Description
When following the "Snap points" example it seems several things are missing. It is not explained how to create the property set and set the snapDistance
.
_propSet = ElementCompositionPreview.GetScrollViewerManipulationPropertySet(scrollPanel);
_propSet.InsertScalar("snapDistance", 400);
Another thing that is missing is what _root
refers to. I take it that refers to the root visual of the page and not the ScrollViewer
s visual?
However after adding these to an example page with a ScrollViewer
it only scrolls the entire page down including scrollbar, so I guess I'm animating the wrong visual and for some reason it won't scroll up either.
I've added the following statement to set _root
:
_root = ElementCompositionPreview.GetElementVisual(scrollPanel);
And it seemd logical to increate the _tracker.MaxPosition
:
_tracker.MaxPosition = new Vector3(scrollPanel.ActualSize.Y);
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: a5380cd5-0823-c7a2-db3d-858eb9b05da0
- Version Independent ID: 19d0d893-9c2c-adfb-33ce-724b3d42c7a0
- Content: Use inertia modifiers to create snap points - UWP applications
- Content Source: windows-apps-src/composition/inertia-modifiers.md
- Product: uwp
- Technology: platform
- GitHub Login: @jwmsft
- Microsoft Alias: jimwalk