Repository navigation
Improvements
-
iOS / Mac Catalyst rebinds rows far less often. Rows that rebuild content on
BindingContextChanged, or that have expensive bindings, do much less work during reloads, size changes (rotation, fold/unfold, window resizes), and when the list first connects. (#82, #83)- Cell reuse keeps the previous
BindingContextuntil the next item is bound, the same as Android.BindingContextused to be cleared on reuse, which pushed default values through every binding. - When UIKit asks again for a row it already showed, the item isn't reset unless the data changed in the meantime. Data invalidations, item refreshes, and keyed updates still re-apply bindings.
- One native reload when the list connects. Connecting used to call
ReloadData()once per mapped property, 11 times in total. - Rows keep their content when UIKit shuffles cells. After a reload or a size change, UIKit returns the visible cells in arbitrary order. Each row used to be rebuilt for an item that a different cell had just shown. Now, when a cell is asked for an item that a pooled cell still holds, the two cells swap content, so nothing is rebuilt.
In a fold/unfold test with about 8 visible rows over 3 cycles,
BindingContextChangedevents dropped from 48 to 0, and connect-time reloads dropped from 11 to 1. - Cell reuse keeps the previous
Notes
- To turn off the content swapping between cells, call
AppContext.SetSwitch("Microsoft.Maui.VirtualListView.DisableContentAffinity", true)at startup. - Pooled iOS cells now hold a reference to their last item until they are reused or released, as on Android.
No public API changes. Upgrading from 0.5.7 needs no code changes.