Xenko

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • Manual
  • API
  • Release notes
    Show / Hide Table of Contents

    Layout system

    Intermediate Programmer Designer

    The Xenko UI layout system is similar to Windows Presentation Foundation (WPF). For more information about the WPF layout system, see the MSDN documentation. Much of the WPF documentation also applies to the Xenko layout system.

    Every @'SiliconStudio.Xenko.UI.UIElement' in the Xenko UI system has a surrounding rectangle used in layouts. Xenko computes layouts according to the @'SiliconStudio.Xenko.UI.UIElement' requirement, available screen space, constraints, margins, padding, and the special behavior of @'SiliconStudio.Xenko.UI.Panels.Panel' elements (which arrange children in specific ways).

    Processing this data recursively, the layout system computes a position and size for every @'SiliconStudio.Xenko.UI.UIElement' in the UI system.

    Measure and arrange

    Xenko performs the layout process recursively in two passes: Measure and Arrange.

    Measure

    In the Measure pass, each element recursively computes its DesiredSize according to the properties you set, such as @'SiliconStudio.Xenko.UI.UIElement.Width', @'SiliconStudio.Xenko.UI.UIElement.Height', and @'SiliconStudio.Xenko.UI.UIElement.Margin'.

    Some @'SiliconStudio.Xenko.UI.Panels.Panel' elements call Measure recursively to determine the DesiredSize of their children, and act accordingly.

    Arrange

    The Arrange pass arranges the elements, taking into account:

    • @'SiliconStudio.Xenko.UI.UIElement.Margin'
    • @'SiliconStudio.Xenko.UI.UIElement.Width'
    • @'SiliconStudio.Xenko.UI.UIElement.Height'
    • @'SiliconStudio.Xenko.UI.UIElement.HorizontalAlignment'
    • @'SiliconStudio.Xenko.UI.UIElement.VerticalAlignment'
    • @'SiliconStudio.Xenko.UI.Panels.Panel'
    • specific Arrange rules

    See also

    • MSDN WPF layout documentation
    • UI pages
    • UI libraries
    • UI editor
    • Add a UI to a scene
    • Improve this Doc

    Back to top

    Copyright © 2016 Silicon Studio
    Generated by DocFX