Creating a WPF DockPanel using XAML
By: a guest | Mar 18th, 2010 | Syntax:
XML | Size: 1.68 KB | Hits: 42 | Expires: Never
<Window x:Class="WpfDockPanelExample.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Sundeepan's DockPanel Example">
<DockPanel LastChildFill="True">
<TextBlock DockPanel.Dock="Left"
VerticalAlignment="Center"
Background="Bisque"
Foreground="DarkGoldenrod"
FontFamily="Veranda"
FontSize="20">
I am the left!</TextBlock>
<TextBlock DockPanel.Dock="Right"
VerticalAlignment="Center"
Background="DarkGoldenrod"
Foreground="Bisque"
FontFamily="Veranda"
FontSize="20"
TextAlignment="Center">
I am the right!</TextBlock>
<TextBlock DockPanel.Dock="Top"
Background="OliveDrab"
Foreground="Cornsilk"
FontFamily="Veranda"
FontSize="20"
TextAlignment="Center">
w00h00, look at me, im on top of the world!!!!</TextBlock>
<TextBlock DockPanel.Dock="Bottom"
Background="Cornsilk"
Foreground="OliveDrab"
FontFamily="Veranda"
FontSize="20"
TextAlignment="Center">
aww shucks, I am on the bottom now..in the pits!!!!</TextBlock>
<Button Height="40" Width="200" Click="Button_Click" Background="LightBlue">
I am the fill!("Press me!")
</Button>
</DockPanel>
</Window>