Table of Contents

Class StackLayout

Namespace
MagicUI.Elements
Assembly
MagicUI.dll

A layout that places elements adjacent to each other with optional spacing between each element

public sealed class StackLayout : Layout, ILayoutParent
Inheritance
StackLayout
Implements
Inherited Members
Extension Methods

Remarks

Each panel will be as large as the largest child in one direction, and as large as the child in the panel in the other direction. The panel will be as large as needed to fit each child with the specified spacing and orientation

Constructors

StackLayout(LayoutRoot, string)

Creates a stack layout

public StackLayout(LayoutRoot onLayout, string name = "New StackLayout")

Parameters

onLayout LayoutRoot

The layout root to draw the stack layout on

name string

The name of the stack layout

Properties

Orientation

The orientation/flow direction of the layout

public Orientation Orientation { get; set; }

Property Value

Orientation

Spacing

The spacing between elements in this layout

public float Spacing { get; set; }

Property Value

float

Methods

ArrangeOverride(Vector2)

Internal implementation to position the object within the allocated space.

protected override void ArrangeOverride(Vector2 alignedTopLeftCorner)

Parameters

alignedTopLeftCorner Vector2

The space available for the element.

DestroyOverride()

Internal implementation to perform any additional cleanup when the element is destroyed

protected override void DestroyOverride()

MeasureOverride()

Internal implementation to calculate desired size.

protected override Vector2 MeasureOverride()

Returns

Vector2