ListView virtualization breaks when using different item templates #9307
Labels
area-Lists
ListView, GridView, ListBox, etc
bug
Something isn't working
needs-author-feedback
Asked author to supply more information.
no-recent-activity
team-Controls
Issue for the Controls team
Describe the bug
ListView
virtualization logic breaks when selecting different item templates fromChoosingItemContainer
.Steps to reproduce the bug
Have a
ObservableCollection
filled with items that resolve the sameDataTemplate
A.Replace the items in the collection with a new set of items that resolve the
DataTemplate
B.All the previous
ListViewItem
will end up in the recycle queue, andChoosingItemContainer
will fire proposing the aforementioned containers.Since none of the recycled containers will actually match, a new
ListViewItem
will be created for each new item added to the view.In addition to this, the ListView will stop recycling new containers at all, realizing all items available in the collection and finally breaking any kind of virtualization.
The only way to recover from this seems to be consuming the unmatching containers from the recycle queue, after this the ListView will start to unload out-of-bounds containers and recycle them.
Expected behavior
No response
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.4.4: 1.4.231219000
Windows version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: