Skip to content

Composition: Snap points example not complete #2735

Open
@wldevries

Description

@wldevries

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 ScrollViewers 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.

Metadata

Metadata

Assignees

Labels

Pri2doc-bugfeedback is about something that is out of date, unclear, confusing, or broken in the articleplatform/techuwp/prod

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions