Im new in WPF & Xaml
I dont know how to anchor how to dock…
On this screen gray is statusBar is docked but grid and menu is not all components are in canvas.
This is XAML
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="WpfApplication6.MainWindow"
x:Name="Window"
Title="MainWindow"
Width="640" Height="480">
<Grid x:Name="LayoutRoot">
<Canvas>
<StackPanel Height="40" Width="624" VerticalAlignment="Top" HorizontalAlignment="Center">
<Menu Height="39" Margin="1,0,0,0">
<Menu.Background>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FFF6F6F6" Offset="0.25"/>
<GradientStop Color="#FFEAE8E8" Offset="0.25"/>
<GradientStop Color="#FFDCD9D9" Offset="0.8"/>
<GradientStop Color="White" Offset="1"/>
</LinearGradientBrush>
</Menu.Background>
</Menu>
</StackPanel>
<StackPanel Height="356" Canvas.Top="44" Width="161" HorizontalAlignment="Left">
<Expander Header="Expander" Height="107">
<Grid Background="#FFE5E5E5"/>
</Expander>
</StackPanel>
<StackPanel Height="360" Canvas.Left="161" Canvas.Top="40" Width="463">
<DataGrid Height="361"/>
</StackPanel>
</Canvas>
<StackPanel Height="40" Margin="-1,0,0,0" VerticalAlignment="Bottom">
<StatusBar Height="40" Background="#FF897676"/>
</StackPanel>
</Grid>

You don’t want these things to go in a
Canvas. I’m not sure I’ve ever used aCanvasin WPF.DockPanelis your friend, and this is how it works:DockPanelgets aDockPanel.Dockattached property : Left, Top, Right, or BottomDockPanel. So, even if you want the “fill” control to be at the very top, you make it the last item in theDockPaneland setDockPanel.Dock="Top".At its most basic,
DockPanelcan be used just likeStackPanelexcept it will fill available space.