How to get these dockpanels right ?
<DockPanel Grid.Row="1" LastChildFill="True" HorizontalAlignment="Stretch">
<DockPanel Width="400" LastChildFill="False" HorizontalAlignment="Left">
<DockPanel>
<TextBlock Width="400" />
</DockPanel>
<DockPanel Height="35" DockPanel.Dock="Bottom" LastChildFill="False">
<Button x:Name="btnRefresh" Content="Refersh" />
</DockPanel>
</DockPanel>
The DockPanel with the TextBlock spans over the DockPanel that is docked at the bottom, I want it to fit right up to it. Any ideas?
Ok, it turns out: the panel docked at the bottom must preceed the dockpanel above it in the xaml declaration. LastChildFill="True" applies to the control that is declared last in the code.
<DockPanel Grid.Row="1" LastChildFill="True" HorizontalAlignment="Stretch">
<DockPanel Width="400" LastChildFill="False" HorizontalAlignment="Left">
<DockPanel Height="35" DockPanel.Dock="Bottom" LastChildFill="False">
<Button x:Name="btnRefresh" Content="Refersh" />
</DockPanel>
<DockPanel>
<TextBlock Width="400" />
</DockPanel>
</DockPanel>