Skip to main content

GridLength Structure

Holds the width or height of a Grid's column and row definitions.

Definition​

Namespace: Avalonia.Controls
Assembly: Avalonia.Controls (in Avalonia.Controls.dll)

public struct GridLength : IEquatable<GridLength>
View Source
InheritanceObject → ValueType → GridLength
ImplementsIEquatable(GridLength)

Constructors​

GridLength(Double)Initializes a new instance of the GridLength struct.
GridLength(Double, GridUnitType)Initializes a new instance of the GridLength struct.

Properties​

AutoGets an instance of GridLength that indicates that a row or column should auto-size to fit its content.
GridUnitTypeGets the unit of the GridLength.
IsAbsoluteGets a value that indicates whether the GridLength has a GridUnitType of Pixel.
IsAutoGets a value that indicates whether the GridLength has a GridUnitType of Auto.
IsStarGets a value that indicates whether the GridLength has a GridUnitType of Star.
StarGets an instance of GridLength that indicates that a row or column should fill its content.
ValueGets the length.

Methods​

Equals(GridLength)Compares two GridLength structures for equality.
Equals(Object)Determines whether the GridLength is equal to the specified object.
(Overrides ValueType.Equals(Object))
GetHashCode()Gets a hash code for the GridLength.
(Overrides ValueType.GetHashCode())
GetType()Gets the Type of the current instance.
(Inherited from Object)
Parse(String)Parses a string to return a GridLength.
ParseLengths(String)Parses a string to return a collection of GridLengths.
ToString()Gets a string representation of the GridLength.
(Overrides ValueType.ToString())

Operators​

Equality(GridLength, GridLength)Compares two GridLength structures for equality.
Inequality(GridLength, GridLength)Compares two GridLength structures for inequality.

See Also​

Reference​

Avalonia.Controls Namespace