Share via


GridLength Struct

Definition

Used to define the size (width/height) of Grid ColumnDefinition and RowDefinition.

public value class GridLength
public readonly struct GridLength
[System.ComponentModel.TypeConverter(typeof(Microsoft.Maui.GridLength+GridLengthTypeConverter))]
public readonly struct GridLength
type GridLength = struct
[<System.ComponentModel.TypeConverter(typeof(Microsoft.Maui.GridLength+GridLengthTypeConverter))>]
type GridLength = struct
Public Structure GridLength
Inheritance
GridLength
Attributes

Remarks

GridLength of type GridUnitType.Absolute represents exact size. The ones of type GridUnitType.Auto adapts for fitting the size of the elements in the grid column/row. GridLength of type GridUnitType.Star are used to split the available size in proportional buckets.

This valuetype is readonly.

Constructors

GridLength(Double, GridUnitType)

Initializes a new GridLength.

GridLength(Double)

Initializes a new Absolute GridLength.

Fields

Auto

A ready to reuse GridLength of GridUnitType.Auto.

Star

A ready to reuse GridLength of GridUnitType.Star with a Value of 1.

Properties

GridUnitType

Gets or sets the GridUnitType of the GridLength

IsAbsolute

Gets whether or not the GridUnitType of the GridLength is GridUnitType.Absolute.

IsAuto

Gets whether or not the GridUnitType of the GridLength is GridUnitType.Auto.

IsStar

Gets a value that indicates whether the GridUnitType of the GridLength is GridUnitType.Star.

Value

Gets the Value of the GridLength.

Methods

Equals(Object)

Test the equality of this GridLength and another one.

GetHashCode()

Returns a value that is used for efficient storage of this object in collections.

ToString()

Returns the value and the grid unit type, separated by a ".".

Operators

Equality(GridLength, GridLength)
Implicit(Double to GridLength)
Inequality(GridLength, GridLength)

Applies to