Table of Contents

Class DynamicUniformGrid

Namespace
MagicUI.Elements
Assembly
MagicUI.dll

A layout that places elements adjacent to each other in a grid with a dynamic number of rows/columns

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

Remarks

Each panel in the grid is the size of the largest element; the grid will be as large as needed to fit one panel per child with the required number of rows/columns and spacing based on the specified parameters

Constructors

DynamicUniformGrid(LayoutRoot, string)

Creates a dynamic uniform grid layout

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

Parameters

onLayout LayoutRoot

The layout root to draw the grid on

name string

The name of the grid

Properties

ChildrenBeforeRollover

The number of children before spilling over to the next row/column. In other words, the maximum number of columns if Orientation is Vertical, or the maximum number of rows if Orientation is Horizontal

public int ChildrenBeforeRollover { get; set; }

Property Value

int

Remarks

By default, the value is 2, and cannot be set lower. If you want to use this with one row/column, you should use a StackLayout instead

HorizontalSpacing

The layout's spacing between columns

public float HorizontalSpacing { get; set; }

Property Value

float

Orientation

The orientation/flow direction of the layout

public Orientation Orientation { get; set; }

Property Value

Orientation

VerticalSpacing

The layout's spacing between rows

public float VerticalSpacing { 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