CollectionView ItemsUpdatingScrollMode got to top of list #26032
Unanswered
IeuanWalker
asked this question in
Ideas
Replies: 1 comment
-
My current workaround - I have created a viewModel.PropertyChanged += async (object? _, PropertyChangedEventArgs e) =>
{
if(e.PropertyName is null)
{
return;
}
if(e.PropertyName.Equals(nameof(viewModel.DataChanged)))
{
await Task.Delay(100);
itemCollectionView.ScrollTo(0);
}
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Currently the CollectionView ItemsUpdatingScrollMode, has 3 options -
KeepItemsInView
keeps the first item in the list displayed when new items are added.KeepScrollOffset
ensures that the current scroll position is maintained when new items are added.KeepLastItemInView
adjusts the scroll offset to keep the last item in the list displayed when new items are added.ItemsUpdatingScrollMode
A common use case for CollectionView is searching a collection -
And ideally every time the user searches for something you'd want to look at the top results. But currently using
ItemsUpdatingScrollMode
there is no way to achieve this.You can see what I mean in the following video. I search for the item at the bottom of the list, I then clear the search, but the scroll position is still stuck at the bottom, and the user has to scroll back up them selves
https://github.com/user-attachments/assets/ad8ecd27-921d-4abe-82f6-d92ef0ae8a5b
Public API Changes
ItemsUpdatingScrollMode
has a new optionGoToStart
Intended Use-Case
see description
Beta Was this translation helpful? Give feedback.
All reactions