What's a good guide to WPF Panels & layout in general?

狂风中的少年 提交于 2019-12-09 17:16:17

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/743070/whats-a-good-guide-to-wpf-panels-layout-in-general

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!