How to create a Dock Panel in WPF

The code listed in Listing creates a DockPanel with five Button elements. Four buttons are docked and the last one has no docking set that fills the entire remaining area.

<DockPanel Name="dcPanel">        

    <Button Name="TopRect" DockPanel.Dock="Top" Background="LightGreen"

            Height="50" Content="Top"/>

    <Button Name="LeftRect" DockPanel.Dock="Left" Background="LightBlue"

            Width="50" Content="Left"/>

    <Button Name="RightRect" DockPanel.Dock="Right" Background="LightSalmon"

            Width="50" Content="Right"/>

    <Button Name="BottomRect" DockPanel.Dock="Bottom" Background="LightCyan"

            Height="50"/>

    <Button Name="Fill" Background="LightGray" />

</DockPanel>