DockPanel 面板是根据外边缘进行控件的拉伸,DockPanel的LastChildFill属性设置为True 时,最后一个添加的控件将占满剩余空间。
<DockPanel LastChildFill="True">
<Button DockPanel.Dock="Top">Top ButtonButton>
<Button DockPanel.Dock="Bottom">Bottom ButtonButton>
<Button DockPanel.Dock="Left">Left ButtonButton>
<Button DockPanel.Dock="Right">Right ButtonButton>
<Button>Remaining SpaceButton>
DockPanel>