[Windows] Address CollectionView virtualization#18813
Conversation
| 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.
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
CollectionViewdue to a lack ofMinHeighton the items, the initialMeasureOverridecall 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
MeasureOverrideis 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