Table of Contents

Class Grid

Namespace
PluginUI
Assembly
PluginUI.dll

Rows × columns layout with Auto, fixed and star sizes, spans and spacing. Children use Row, Column, RowSpan and ColumnSpan.

public class Grid : Panel
Inheritance
Grid
Inherited Members

Examples

var grid = new Grid("Auto,*", "120,*,120") { ColumnSpacing = 8 };

Constructors

Grid()

Creates an empty grid (one star row and column).

public Grid()

Grid(string, string)

Creates a grid from comma-separated definitions ("Auto,,2,100").

public Grid(string rows, string columns)

Parameters

rows string
columns string

Properties

ActualColumnWidths

Column widths after the last layout.

public IReadOnlyList<float> ActualColumnWidths { get; }

Property Value

IReadOnlyList<float>

ActualRowHeights

Row heights after the last layout.

public IReadOnlyList<float> ActualRowHeights { get; }

Property Value

IReadOnlyList<float>

ColumnDefinitions

Column sizes (empty = one star column).

public List<GridLength> ColumnDefinitions { get; }

Property Value

List<GridLength>

ColumnSpacing

Space between columns.

public float ColumnSpacing { get; set; }

Property Value

float

RowDefinitions

Row sizes (empty = one star row).

public List<GridLength> RowDefinitions { get; }

Property Value

List<GridLength>

RowSpacing

Space between rows.

public float RowSpacing { get; set; }

Property Value

float

Methods

Add(UIElement, int, int, int, int)

Adds a child at a cell (fluent).

public Grid Add(UIElement element, int row, int column, int rowSpan = 1, int columnSpan = 1)

Parameters

element UIElement
row int
column int
rowSpan int
columnSpan int

Returns

Grid

ArrangeOverride(Rect)

Arranges children inside the final bounds.

protected override void ArrangeOverride(Rect bounds)

Parameters

bounds Rect

MeasureOverride(Size)

Natural size of the content for the available size (margins excluded).

protected override Size MeasureOverride(Size available)

Parameters

available Size

Returns

Size