WPFwiki, wpf, wiki, .net 3.0, windows presentation foundation, FAQ, free resources, solution, development, microsoft Home of the world's largest WPF FAQ
Edit

Category

Layout

Edit

Question

How does layout work?

Edit

Answer

Layout is the general principle in which controls are placed and sized in the client area of your application.

Layout is performed in a two-pass recursive process: Measure and Arrange.

In the Measure pass, a parent element asks its children how big they would like to be (their DesiredSize), considering the size that is available to them. The parent does so by calling the child's Measure.

In the Arrange pass, a parent element tells its children what their final size is (their ActualSize), by calling the child's Arrange.

The custom measuring and placement intelligence is implemented in the MeasureOverride and ArrangeOverride methods of each control.

All content is Copyright ©2007 Xceed Software Inc. unless otherwise indicated. See the Terms of Service. Contributors must read and agree to the Contribution Policy. WPFwiki is brought to you by Xceed, makers of the powerful yet free Xceed DataGrid for WPF.