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
Properties
ActualColumnWidths
Column widths after the last layout.
public IReadOnlyList<float> ActualColumnWidths { get; }
Property Value
ActualRowHeights
Row heights after the last layout.
public IReadOnlyList<float> ActualRowHeights { get; }
Property Value
ColumnDefinitions
Column sizes (empty = one star column).
public List<GridLength> ColumnDefinitions { get; }
Property Value
ColumnSpacing
Space between columns.
public float ColumnSpacing { get; set; }
Property Value
RowDefinitions
Row sizes (empty = one star row).
public List<GridLength> RowDefinitions { get; }
Property Value
RowSpacing
Space between rows.
public float RowSpacing { get; set; }
Property Value
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
Returns
ArrangeOverride(Rect)
Arranges children inside the final bounds.
protected override void ArrangeOverride(Rect bounds)
Parameters
boundsRect
MeasureOverride(Size)
Natural size of the content for the available size (margins excluded).
protected override Size MeasureOverride(Size available)
Parameters
availableSize