I have a WrapPanel placed in a grid and fill it dynamically with ToggleButtons.
The height of the row, where the wrappanel is located in, is calculated based on the number of ToggleButtons in the WrapPanel component.
When I load my screen the items in the wrappanel aren't layouted correctly.
However when I resize my form the items are shown correctly.
Is there a method where you can force to relayout the items like it does when you resize your form ?
Below you can see my WPF code:
<Grid x:Name="grdScreen">
<Grid.RowDefinitions>
<RowDefinition x:Name="rdToolBar" Height="21" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ToggleButton Grid.Column="0" Name="btnlegende" Margin="1,1,11,1" Click="btnlegende_Click" />
<Button Grid.Column="1" Name="btnlayout" Margin="1" Click="btnlayout_Click" />
<WrapPanel x:Name="pnlHeader" Grid.Column="2" />
</Grid>
...
</Grid>