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

ListView virtualization breaks when using different item templates #9307

Closed
FrayxRulez opened this issue Feb 1, 2024 · 2 comments
Closed
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

Comments

@FrayxRulez
Copy link

FrayxRulez commented Feb 1, 2024

Describe the bug

ListView virtualization logic breaks when selecting different item templates from ChoosingItemContainer.

Steps to reproduce the bug

Have a ObservableCollection filled with items that resolve the same DataTemplate 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, and ChoosingItemContainer 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

@FrayxRulez FrayxRulez added the bug Something isn't working label Feb 1, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Feb 1, 2024
@FrayxRulez FrayxRulez changed the title ListView recycle breaks when using different templates ListView virtualization breaks when using different templates Feb 1, 2024
@FrayxRulez FrayxRulez changed the title ListView virtualization breaks when using different templates ListView virtualization breaks when using different item templates Feb 1, 2024
@codendone codendone added area-Lists ListView, GridView, ListBox, etc team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Feb 15, 2024
@ranjeshj ranjeshj added the needs-author-feedback Asked author to supply more information. label Feb 27, 2024
@ranjeshj
Copy link
Contributor

@FrayxRulez can you please share a repro project?

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants