Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有关于从 System.Windows.Controls.Panel 继承的控件的各种行为的简明指南?或者只是一般的 WPF 布局指南?
特别是,我对面板如何处理宽度或高度设置为“自动”且水平或垂直对齐设置为“拉伸”的子对象感兴趣。一些布局使对象填充其容器的大小,而另一些布局只是使它们根据自己的内容调整大小。
请参阅http://msdn.microsoft.com/en-us/library/ms754152.aspx开始...听起来您可能对“用户界面面板”部分中的表格特别感兴趣。
我建议首先查看有关面板和此示例的MSDN 条目。MeasureOverride 和 ArrangeOverride 方法处理所有与布局相关的逻辑。