O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Arrange Step

After measurement has been completed all the way through the element tree, it’s time for the physical arranging of elements. In the arrange step, parents tell their children where they are getting placed and how much space they are given (which might be a different Size than the one given earlier). Panels (and children, when appropriate) do this by overriding the ArrangeOverride method from FrameworkElement. Here’s an example:

protected override Size ArrangeOverride(Size finalSize){  ...  // Tell each child how much space it is getting  foreach (UIElement child in this.Children)  {    child.Arrange(new Rect(...));    // The child's size is now in child.ActualHeight & child.ActualWidth    ...  }

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required