Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple implementation of IScrollAnchorProvider. #3436

Draft
wants to merge 1 commit into
base: master
from

Conversation

@grokys
Copy link
Member

grokys commented Jan 13, 2020

What does the pull request do?

A minimal implementation of scroll anchoring which is intended to improve scrolling in the ItemsPresenter with items of differing heights/widths.

This functionality is defined in UWP but this PR doesn't attempt to implement all of UWP's features here, in particular:

On `ScrollContentPresenter`.
@@ -133,6 +135,9 @@ public Size Viewport
private set { SetAndRaise(ViewportProperty, ref _viewport, value); }
}

/// <inheritdoc/>
IControl IScrollAnchorProvider.CurrentAnchor => _anchor.Item1;

This comment has been minimized.

Copy link
@MarchingCube

MarchingCube Jan 13, 2020

Member

I think you could just write _anchor.control for clarity. Since in some places you are using Item1 and in some control.

@MarchingCube

This comment has been minimized.

Copy link
Member

MarchingCube commented Jan 13, 2020

Does this already fix scrollbar jumping around in ItemsRepeater when using non-uniform items heights in StackLayout ?

@grokys

This comment has been minimized.

Copy link
Member Author

grokys commented Jan 13, 2020

Does this already fix scrollbar jumping around in ItemsRepeater when using non-uniform items heights in StackLayout ?

It doesn't fix the scrollbar jumping around, but it does fix scrolling with e.g. the mousewheel causing the contents of the ItemsRepeater jumping around. I don't think there's any way to prevent the scrollbar jumping around without having extra information about the size of non-materialized items.

@MarchingCube

This comment has been minimized.

Copy link
Member

MarchingCube commented Jan 17, 2020

Just so we don't forget - after this change ItemsRepeater sometimes gets stuck when scrolling so there might be an issue somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.