<Window x:Class="布局.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="布局测试" Height="350" Width="525">
<StackPanel Orientation="Vertical">
<!--Orientation布局方向-->
<Label Height="50"> A Button Stack</Label>
<Button Height="54">button1</Button>
<Button Height="57">button2</Button>
<Button Height="54">button3</Button>
<Button Height="47">button4</Button>
<Button Height="58">button5</Button>
</StackPanel>
</Window>
<Window x:Class="布局.WrapPanel面板"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title="WrapPanel面板" Height="300" Width="309.195"><WrapPanel Orientation="Vertical"><Button Content="Button1" Width="75"/><Button Content="Button2" Width="75"/><Button Content="Button3" Width="75"/><Button Content="Button4" Width="75"/><Button Content="Button5" Width="75"/><Button Content="Button6" Width="75"/><Button Content="Button7" Width="75"/><Button Content="Button8" Width="75"/><Button Content="Button9" Width="75"/><Button Content="Button10" Width="75"/><Button Content="Button11" Width="75"/><Button Content="Button12" Width="75"/><Button Content="Button13" Width="75"/><Button Content="Button14" Width="75"/><Button Content="Button15" Width="75"/><Button Content="Button16" Width="75"/></WrapPanel></Window>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title="DockPanel面板" Height="300" Width="300">
<Border Margin="10,10" Background="LightBlue" BorderBrush="Pink" BorderThickness="5" CornerRadius="20"><DockPanel LastChildFill="False"><Button Content="top1" DockPanel.Dock="Top"></Button><Button Content="left1" DockPanel.Dock="Left"></Button><Button Content="right1" DockPanel.Dock="Right"></Button><Button Content="bottom1" DockPanel.Dock="Bottom"></Button></DockPanel></Border></Window>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title="Grid*容器" Height="300" Width="300"><Grid ShowGridLines="True"><Grid.RowDefinitions><RowDefinition></RowDefinition><RowDefinition></RowDefinition></Grid.RowDefinitions><Grid.ColumnDefinitions><ColumnDefinition></ColumnDefinition><ColumnDefinition></ColumnDefinition><ColumnDefinition></ColumnDefinition></Grid.ColumnDefinitions><Button Content="TopLeft" Grid.Row="0" Grid.Column="0"></Button><Button Content="MiddleLeft" Grid.Row="0" Grid.Column="1"></Button><Button Content="BottomRight" Grid.Row="1" Grid.Column="2"></Button><Button Content="BottomMiddle" Grid.Row="1" Grid.Column="1"></Button></Grid></Window>
<Window x:Class="布局.UniformGrid面板"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="UniformGrid面板" Height="300" Width="300">
<Border Background="LightGray" BorderBrush="Brown" BorderThickness="5,5" CornerRadius="10" Margin="5">
<UniformGrid Rows="2" Columns="2">
<Button>top left</Button>
<Button>top right</Button>
<Button>bottom left</Button>
<Button>bottom right</Button>
</UniformGrid>
</Border>
</Window>
<Window x:Class="布局.Canvas面板"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Canvas面板" Height="300" Width="300">
<Border BorderBrush="Beige" BorderThickness="10" Margin="5" Background="YellowGreen" CornerRadius="15">
<Canvas>
<Button Canvas.Left="10" Canvas.Top="10">10,10</Button>
<Button Canvas.Left="20" Canvas.Top="20">20,20</Button>
<Button Canvas.Left="30" Canvas.Top="40">30,40</Button>
<Button Canvas.Right="60" Canvas.Bottom="50">60,50</Button>
</Canvas>
</Border>
</Window>
<Window x:Class="布局.border控件"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title="border控件" Height="300" Width="300"><Border Margin="7" Padding="15" Background="LightYellow" BorderBrush="SteelBlue" BorderThickness="3,5,3,5" CornerRadius="5" VerticalAlignment="Top"><StackPanel><Label Name="lb">One</Label><Button Name="bt2">Two</Button><Button Name="bt3">Three</Button></StackPanel></Border></Window>