-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Windows] Address CollectionView virtualization #18813
Conversation
@@ -284,6 +284,10 @@ protected override WSize MeasureOverride(WSize availableSize) | |||
{ | |||
if (_renderer == null) | |||
{ | |||
// Make sure we supply a real number for height otherwise virtualization won't function | |||
if (double.IsFinite(availableSize.Width) && !double.IsFinite(availableSize.Height)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to make sure this is ok in CV scenarios where we have horizontal list scrolling set as the layout.
Hi, I couldn't figure out where i shall use MeasureOverride to prevent CollectionView load all data at databinding Here is my simple code
|
Hi, i tried both MesureOverride of CollectionView and Grid. MeasureOverride of Grid is never calling, CollectionView's MeasureOverride is called with infinity value. Set it to an integer. But noway, it still attempts to loads all rows at databinding. This issue is marked as fixed and closed. But i couldn't make it work for maui windows. Any help on this? Or (I don't know the terminology) is this fix planned to be published later with SR1 or SR2? My older post #18913 Best Regards |
I also have the same issue in Window. Using 2000 items in collection view just with one label makes the app stuck and not respond. Using .NET 8 LTS. Please. If there is a workaround for time being, please let us know. |
Description of Change
This PR some-what addresses virtualization being broken in
CollectionView
due to a lack ofMinHeight
on the items, the initialMeasureOverride
call returning an infinite height, and creating the ListView items at the DataBinding-time.You can see the behavior in an isolated WinUI context here: https://github.com/Foda/ListViewVirtualization/tree/master
The fix for this issue is to just return a real-number value (32) when the initial call to
MeasureOverride
is done. It's not perfect, but very large lists will benefit from it.Note: this behavior was regressed due to #18356
Issues Fixed
Fixes #18639 #18510