Skip to main content

GridLength Struct

Definition

Assembly:Avalonia.Controls
Package:Avalonia

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

public struct GridLength

Inheritance: ValueType -> GridLength

Implements: IEquatable<GridLength>

Constructors

NameDescription
GridLength (2 overloads)Initializes a new instance of the Avalonia.Controls.GridLength struct.

GridLength overloads

GridLength Constructor

Initializes a new instance of the Avalonia.Controls.GridLength struct.

public GridLength(double value)
Parameters

value double

The size of the GridLength in device independent pixels.

GridLength Constructor

Initializes a new instance of the Avalonia.Controls.GridLength struct.

public GridLength(double value, Avalonia.Controls.GridUnitType type)
Parameters

value double

The size of the GridLength.

type Avalonia.Controls.GridUnitType

The unit of the GridLength.

Methods

NameDescription
Equals (2 overloads)Compares two GridLength structures for equality.
GetHashCodeGets a hash code for the GridLength.
ParseParses a string to return a Avalonia.Controls.GridLength.
ParseLengthsParses a string to return a collection of Avalonia.Controls.GridLengths.
ToStringGets a string representation of the Avalonia.Controls.GridLength.

Equals overloads

Equals Method

Compares two GridLength structures for equality.

public bool Equals(Avalonia.Controls.GridLength gridLength)
Parameters

gridLength Avalonia.Controls.GridLength

The structure with which to test equality.

Returns

bool

True if the structures are equal, otherwise false.

Equals Method

Determines whether the Avalonia.Controls.GridLength is equal to the specified object.

public bool Equals(object o)
Parameters

o object

The object with which to test equality.

Returns

bool

True if the objects are equal, otherwise false.

GetHashCode Method

Gets a hash code for the GridLength.

public int GetHashCode()

Returns

int

The hash code.

Parse Method

Parses a string to return a Avalonia.Controls.GridLength.

public Avalonia.Controls.GridLength Parse(string s)

Parameters

s string

The string.

Returns

Avalonia.Controls.GridLength

The Avalonia.Controls.GridLength.

ParseLengths Method

Parses a string to return a collection of Avalonia.Controls.GridLengths.

public System.Collections.Generic.IEnumerable<Avalonia.Controls.GridLength> ParseLengths(string s)

Parameters

s string

The string.

Returns

System.Collections.Generic.IEnumerable<Avalonia.Controls.GridLength>

The Avalonia.Controls.GridLength.

ToString Method

Gets a string representation of the Avalonia.Controls.GridLength.

public string ToString()

Returns

string

The string representation.

Properties

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

Auto Property

Gets an instance of Avalonia.Controls.GridLength that indicates that a row or column should auto-size to fit its content.

public Avalonia.Controls.GridLength Auto { get; set; }

GridUnitType Property

Gets the unit of the Avalonia.Controls.GridLength.

public Avalonia.Controls.GridUnitType GridUnitType { get; set; }

IsAbsolute Property

Gets a value that indicates whether the Avalonia.Controls.GridLength has a Avalonia.Controls.GridLength.GridUnitType of Pixel.

public bool IsAbsolute { get; set; }

IsAuto Property

Gets a value that indicates whether the Avalonia.Controls.GridLength has a Avalonia.Controls.GridLength.GridUnitType of Auto.

public bool IsAuto { get; set; }

IsStar Property

Gets a value that indicates whether the Avalonia.Controls.GridLength has a Avalonia.Controls.GridLength.GridUnitType of Star.

public bool IsStar { get; set; }

Star Property

Gets an instance of Avalonia.Controls.GridLength that indicates that a row or column should fill its content.

public Avalonia.Controls.GridLength Star { get; set; }

Value Property

Gets the length.

public double Value { get; set; }