-
Notifications
You must be signed in to change notification settings - Fork 770
Open
Labels
area-ListsListView, GridView, ListBox, etcListView, GridView, ListBox, etcfeature proposalNew feature proposalNew feature proposalneeds-winui-3Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)team-ControlsIssue for the Controls teamIssue for the Controls team
Description
Proposal: Allow scrolling by index in ListView and GridView
Summary
public abstract class ListViewBase
{
// existing
public void ScrollIntoView(object item);
public void ScrollIntoView(object item, ScrollIntoViewAlignment alignment);
// new
+ public void ScrollIntoView(int index);
+ public void ScrollIntoView(int index, ScrollIntoViewAlignment alignment);
}
Rationale
ScrollIntoView
is useful, but it doesn't work well with range-based virtualization (IItemsRangeInfo
). Say I have a list with 100K~1M items, and a jump box to jump at arbitrary position. The current object-based ScrollIntoView
requires creating the corresponding item before scrolling. With index-based scrolling, the item can be created naturally when scrolled to using IItemsRangeInfo
.
It may also improve the performance, since getting index from object is typically way slower than the opposite, and the index is required to perform scrolling.
Scope
Capability | Priority |
---|---|
ListViewBase.ScrollIntoView can take index. |
Must |
Important Notes
Open Questions
roxk, omikhailov, niels9001, winston-de, bogdan-patraucean and 2 moreniels9001niels9001 and jordan-msftfan
Metadata
Metadata
Assignees
Labels
area-ListsListView, GridView, ListBox, etcListView, GridView, ListBox, etcfeature proposalNew feature proposalNew feature proposalneeds-winui-3Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)team-ControlsIssue for the Controls teamIssue for the Controls team