Open moon6969 opened 3 years ago
In case anyone else comes across this issue:
<ItemsControl>
with a <WrapPanel>
doesn't seem to suffer from the same issue as <ItemsRepeater>
with a <WrapLayout>
.
I'm not sure if you lose anything like virtualization support or what not when you make the switch, but if ItemsRepeater and ItemsControl are interchangeable in your case, just change
<ItemsRepeater>
<ItemsRepeater.Layout>
<WrapLayout />
</ItemsRepeater.Layout>
</ItemsRepeater>
to
<ItemsControl>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
and you're good. Or at least, I was, so far. 🤷♂️
Description WrapLayout is not updating correctly when source collection is changed.
Consider an ItemsRepeater bound to a changing source collection "CurrentNode.Things". With
<UniformGridLayout />
the ItemsRepeater displays the correct items from "CurrentNode.Things" as CurrentNode changes.If I change to
<WrapLayout />
, the number of displayed items updates correctly, but any items from the previous source are displayed instead.In the example below, the UniformGridLayout is left, and WrapLayout on the right...
To Reproduce
Expected behavior WrapLayout should display the correct items from source!
Desktop: