Open w-ahmad opened 1 month ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Proposal: Expose a method in ListViewBase that allows scrolling to a specific item using the item's index.
Summary
There should be a method in ListView that can scroll items into view by their index. Currently there is
ScrollIntoView(object item)
that accepts item itself to bring into view. This method isn't useful when there are duplicate items in the ItemsSource. It only brings first matching index to the view.To bring the items into view by calling
ScrollIntoView(object item)
, the internal implementation uses item's index. https://github.com/microsoft/microsoft-ui-xaml/blob/66a7b0ae71c19f89c6a7d86a1986794ad1a1bf09/src/dxaml/xcp/dxaml/lib/Selector_Partial.cpp#L3176 This method accepts the item's index rather than the item itself. It seems possible to expose a method likeScrollIntoView(int index)
inListViewBase
.Rationale
ListViewBase
to scroll duplicate items into view.Scope
ListViewBase
by using it's index.