Anchor in WinForms==Horizontal(+Vertical)Alignment in WPF?
开发者_开发知识库Can't find anchor property in WPF, was it reconstructed to Horizontal and Vertical Alignments? Is it the same? I wanted to stretch my control in both sides (right and left), but it worked rather different than anchor
You can do something like Anchor like this
<...HorizontalAlignment='Stretch' VerticalAlignment='Stretch' Margin='50,50,50,50'.../>
The Anchor and Dock properties of Windows Forms are replaced by appropriate layouting containers in WPF. Depending on what exactly you need you should be able to create your desired layout in WPF with the Grid or DockPanel containers.
There are small white circles at the edges of the control. Click them, and they will be converted to triangles which mean the edge is anchored.
精彩评论