I have the following xaml:
<Border BorderBrush="Black"
BorderThickness="1.5"
CornerRadius="5">
<Grid ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ItemsControl composite:RegionManager.RegionName="MainRegion">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
<Button Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Top" Style="{StaticResource WindowCloseButton}"/>
</Grid>
</Border>
When I resize my window, the items in the wrap panel do not wrap.
It works when the ItemsControl is not in a grid:
<Border BorderBrush="Black"
BorderThickness="1.5"
CornerRadius="5">
<ItemsControl composite:RegionManager.RegionName="MainRegion">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</Border>
Is there a way to get the items to wrap correctly if the ItemsControl is in a Grid?