#429 – Child Element Properties that Affect Layout

Layout panels, like StackPanel and Grid, server as containers, containing child elements whose type is UIElement.  (In reality, most child elements derive from FrameworkElement, which in turns derives from UIElement).

Layout panels honor the following properties of their child elements.  These properties are all defined in FrameworkElement.

  • HorizontalAlignment – Horizontal alignment of an element (left, center, right, stretch)
  • VerticalAlignment – Vertical alignment of an element (top, center, bottom, stretch)
  • Margin – space between elements or between an element and the edge of the containing area
  • Width – width of element (in device indepent units, inches, cm, points, or auto)
  • Height – height of element (in device indepent units, inches, cm, points, or auto)
  • MinWidthminimum width of the element
  • MinHeightminimum height of the element
  • MaxWidthmaximum width of the element
  • MaxHeight – maximum height of the element
Advertisements