The width of the layout area for each item that is contained in an ItemsWrapGrid. The default is Double.NaN, which results in the "Auto" layout behavior.
This statement doesn't look right because the simpliest example proves it wrong:
<ListView> <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsWrapGrid Orientation="Vertical"/> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListViewItem>One</ListViewItem> <ListViewItem>Two</ListViewItem> <ListViewItem>Little bit long Three</ListViewItem> </ListView>
Which renders in to:
I can set width manually:
<ItemsWrapGrid Orientation="Vertical" ItemWidth="300"/>
But it's not what I want. I want ItemWidth automatically adjust to content width. How to do it?
UPD: Solution (somewhat)
It looks like there're no direct simple solution so instead of fixing that bug you may use 3rd party component WrapPanel from Microsoft Community Toolkit (search in NuGet). It has poor perfomance with 5000 items or above though.