Skip to main content

Grid Class

NuGet: GHIElectronics.TinyCLR.UI
Assembly: GHIElectronics.TinyCLR.UI
Namespace: GHIElectronics.TinyCLR.UI.Controls

Row/column layout with pixel, auto, and star sizing (WPF-style subset). Use GetRow / SetRow and GetColumn / SetColumn on children.

public class Grid : Panel

Constructors

Grid()

public Grid()

Creates a new Grid.

Properties

RowDefinitions

public GridLengthCollection RowDefinitions { get; }

The row size definitions.

ColumnDefinitions

public GridLengthCollection ColumnDefinitions { get; }

The column size definitions.

Methods

GetRow(UIElement e)

public static int GetRow(UIElement e)

Gets the grid row assigned to an element.

Returns int

SetRow(UIElement e, int row)

public static void SetRow(UIElement e, int row)

Assigns an element to a grid row.

GetColumn(UIElement e)

public static int GetColumn(UIElement e)

Gets the grid column assigned to an element.

Returns int

SetColumn(UIElement e, int column)

public static void SetColumn(UIElement e, int column)

Assigns an element to a grid column.

MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)

protected override void MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)

Measures children and computes row and column sizes.

ArrangeOverride(int arrangeWidth, int arrangeHeight)

protected override void ArrangeOverride(int arrangeWidth, int arrangeHeight)

Positions each child within its assigned cell.