使用StackPanel面板进行布局

strakPanel面板是最简单的布局容器之一,该面板可以在单行或单列中以堆栈形式放置其子元素

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <StackPanel Orientation="Vertical">
        <Label>title</Label>
        <Button>btn1</Button>
        <Button>btn2</Button>
        <Button>btn3</Button>
    </StackPanel>
</Window>