WPF 面板和面板的良好指南是什么? 一般布局?
对于从 System.Windows.Controls.Panel 继承的控件的各种行为,是否有一个好的、简洁的指南? 或者只是一般的 WPF 布局指南?
特别是,我对面板如何处理宽度或高度设置为“自动”且水平或垂直对齐设置为“拉伸”的子对象感兴趣。 有些布局会导致对象填充其容器的大小,而另一些布局只会使它们根据自己的内容调整大小。
Is there a good, concise guide to the various behaviors of the controls that inherit from System.Windows.Controls.Panel? Or just a WPF layout guide in general?
In particular, I'm interested in how the panels handle child objects that have width or height set to "Auto" and Horizontal or Vertical Alignment set to "Stretch". Some layouts cause the objects to fill the size of their container, others just cause them to size based on their own content.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅 http://msdn.microsoft.com/en-us/library/ms754152。首先...听起来您可能对“用户界面面板”部分中的表格特别感兴趣。
See http://msdn.microsoft.com/en-us/library/ms754152.aspx for a start... it sounds like you may be particularly interested in the table in the "User Interface Panels" section.
我建议查看有关面板的MSDN条目和首先是这个示例。 MeasureOverride 和 ArrangeOverride 方法处理所有与布局相关的逻辑。
I would recommend looking at the MSDN entry about panels and this example in particular first. The methods MeasureOverride and ArrangeOverride handle all layout related logic.