Class GridLayout
A generic grid layout with user-specified rows and columns
public class GridLayout : Layout, ILayoutParent
- Inheritance
-
GridLayout
- Implements
- Inherited Members
- Extension Methods
Remarks
Grid rows and columns are sized semi-dynamically. A row/column with the unit AbsoluteMin will be sized at the specified size and grow to fit children as needed. If a child spans multiple of these rows/columns, each row/column will be allocated height/width proportional to the child's size (assuming it needs to grow at all). Rows/columns with the Proportional unit will proportionally split the remaining available minimum width/height, and grow with each other in step until all children are able to fit.
Constructors
GridLayout(LayoutRoot, string)
Creates a grid layout
public GridLayout(LayoutRoot onLayout, string name = "New GridLayout")
Parameters
onLayout
LayoutRootThe layout root to draw the grid layout on
name
stringthe name of the grid layout
Fields
Column
Attached property for column. This is the first column that the item will appear in the grid. Defaults to 0 and is capped at the last column.
public static AttachedProperty<int> Column
Field Value
ColumnSpan
Attached property for column span. This is the maximum number of columns that an item will occupy. Defaults to 1.
public static AttachedProperty<int> ColumnSpan
Field Value
Row
Attached property for row. This is the first row that the item will appear in the grid. Defaults to 0 and is capped at the last row.
public static AttachedProperty<int> Row
Field Value
RowSpan
Attached property for row span. This is the maximum number of rows that an item will occupy. Defaults to 1.
public static AttachedProperty<int> RowSpan
Field Value
Properties
ColumnDefinitions
Definition of the number of columns, their sizes, and their types. By default this is empty. If the grid is measured with empty column definitions, one will be added for you with a minimum height of 0px.
public NotifyingCollection<GridDimension> ColumnDefinitions { get; }
Property Value
MinHeight
The minimum height to be occupied by the grid
public float MinHeight { get; set; }
Property Value
MinWidth
The minimum width to be occupied by the grid
public float MinWidth { get; set; }
Property Value
RowDefinitions
Definition of the number of rows, their sizes, and their types. By default this is empty. If the grid is measured with empty row definitions, one will be added for you with a minimum height of 0px.
public NotifyingCollection<GridDimension> RowDefinitions { get; }
Property Value
Methods
ArrangeOverride(Vector2)
Internal implementation to position the object within the allocated space.
protected override void ArrangeOverride(Vector2 alignedTopLeftCorner)
Parameters
alignedTopLeftCorner
Vector2The 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()