Xamarin.Forms Guides | Samples

Xamarin.Forms.GridLength Structure

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

See Also: GridLength

Syntax

[System.Diagnostics.DebuggerDisplay("{Value}.{GridUnitType}")]
[Xamarin.Forms.TypeConverter(typeof(Xamarin.Forms.GridLengthTypeConverter))]
public struct GridLength

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 gird column/row. GridLenght of type GridUnitType.Star are used to split the available size in proportional buckets.

This valuetype is readonly.

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0

The members of Xamarin.Forms.GridLength are listed below.

See Also: ValueType

Public Constructors

Initializes a new Absolute GridLength.
Initializes a new GridLength.

Public Properties

[read-only]
static
AutoGridLength. A ready to reuse GridLength of GridUnitType.Auto.
[read-only]
GridUnitTypeGridUnitType. Gets or sets the GridUnitType of the GridLength
[read-only]
IsAbsoluteBoolean. Gets wether or not the GridUnitType of the GridLength is GridUnitType.Absolute.
[read-only]
IsAutoBoolean. Gets wether or not the GridUnitType of the GridLength is GridUnitType.Auto.
[read-only]
IsStarBoolean. Gets a value that indicates whether the GridUnitType of the GridLength is GridUnitType.Star.
[read-only]
static
StarGridLength. A ready to reuse GridLength of GridUnitType.Star with a Value of 1.
[read-only]
ValueDouble. Gets the Value of the GridLength.

Public Methods

override
Equals(Object) : Boolean
Test the equality of this GridLength and another one.
override
GetHashCode() : Int32
Returns a value that is used for efficient storage of this object in collections.
override
ToString() : String
Returns the value and the grid unit type, separated by a ".".

Public Operators

static
Conversion to Xamarin.Forms.GridLength(Implicit)Casting operator to convert a double into a GridLength of type GridUnitType.Absolute