读完了这一节,发现DockPanel就是过去winform中的Dock属性。原来的Dock属性是子控件设置,而其父亲级别不用设置。现在WPF改为在父亲级别抽象出一个DockPanel,然后设置其下子控件的Dock属性。
<DockPanel LastChildFill="True">
<Button DockPanel.Dock="Left">Left</Button>
<Button DockPanel.Dock="Right">Right</Button>
<Button DockPanel.Dock="Top">Top</Button>
<Button DockPanel.Dock="Bottom">Bottom</Button>
<Button>Fill</Button>
</DockPanel>
原文:http://www.cnblogs.com/lonelyxmas/p/4962801.html