Share via


GridLength Struct

Definition

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

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

Remarks

GridLength of type Absolute represents exact size. GridLength of type Auto adapts to fit content size. GridLength of type Star distributes remaining space proportionally. This value type is readonly.

Constructors

GridLength(Double, GridUnitType)

Initializes a new GridLength instance with the specified value and unit type.

GridLength(Double)

Initializes a new GridLength instance that represents an absolute length.

Fields

Auto

A ready-to-use GridLength of Auto. Value is ignored.

Star

A ready-to-use GridLength of Star. Distributes available space proportionally.

Properties

GridUnitType

Gets the unit type that indicates how the GridLength is interpreted.

IsAbsolute

Gets a value indicating whether this GridLength uses Absolute units.

IsAuto

Gets a value indicating whether this GridLength uses Auto sizing.

IsStar

Gets a value indicating whether this GridLength uses Star (proportional) sizing.

Value

Gets the numeric value of the GridLength. Represents an absolute size or weight; ignored for Auto.

Methods

Equals(Object)

Determines whether the specified object is equal to the current GridLength.

GetHashCode()

Returns the hash code for this GridLength.

ToString()

Returns a string that represents this GridLength.

Operators

Equality(GridLength, GridLength)

Indicates whether two GridLength instances are equal.

Implicit(Double to GridLength)

Converts a double to a GridLength using Absolute units.

Inequality(GridLength, GridLength)

Indicates whether two GridLength instances are not equal.

Applies to