Class UniformGrid
UniformGrid is used to arrange children in a grid with all equal cell sizes.
Inherited Members
Namespace: System.Windows.Controls.Primitives
Assembly: OpenSilver.dll
Syntax
public class UniformGrid : Panel, IFrameworkElement, IUIElement, IDependencyObject
Constructors
| Improve this Doc View SourceUniformGrid()
Default constructor.
Declaration
public UniformGrid()
Fields
| Improve this Doc View SourceColumnsProperty
DependencyProperty for Columns property.
Declaration
public static readonly DependencyProperty ColumnsProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FirstColumnProperty
FirstColumnProperty
Declaration
public static readonly DependencyProperty FirstColumnProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
RowsProperty
DependencyProperty for Rows property.
Declaration
public static readonly DependencyProperty RowsProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceColumns
Specifies the number of columns in the grid A value of 0 indicates that the column count should be dynamically computed based on the number of rows (if specified) and the number of non-collapsed children in the grid
Declaration
public int Columns { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
FirstColumn
the start column to arrange children. Leave first 'FirstColumn' cells blank.
Declaration
public int FirstColumn { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Rows
Specifies the number of rows in the grid A value of 0 indicates that the row count should be dynamically computed based on the number of columns (if specified) and the number of non-collapsed children in the grid
Declaration
public int Rows { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceArrangeOverride(Size)
Arrange the children of this UniformGrid by distributing space evenly among all of the children, making each child the size equal to a cell's portion of the given arrangeSize (e.g. for a 2 x 4 grid, the child size would be arrangeSize0.5 x arrangeSize0.25)
Declaration
protected override Size ArrangeOverride(Size arrangeSize)
Parameters
Type | Name | Description |
---|---|---|
Size | arrangeSize | Arrange size |
Returns
Type | Description |
---|---|
Size |
Overrides
| Improve this Doc View SourceMeasureOverride(Size)
Compute the desired size of this UniformGrid by measuring all of the children with a constraint equal to a cell's portion of the given constraint (e.g. for a 2 x 4 grid, the child constraint would be constraint.Width0.5 x constraint.Height0.25). The maximum child width and maximum child height are tracked, and then the desired size is computed by multiplying these maximums by the row and column count (e.g. for a 2 x 4 grid, the desired size for the UniformGrid would be maxChildDesiredWidth2 x maxChildDesiredHeight4).
Declaration
protected override Size MeasureOverride(Size constraint)
Parameters
Type | Name | Description |
---|---|---|
Size | constraint | Constraint |
Returns
Type | Description |
---|---|
Size | Desired size |