GridLength Structure

Represents the length of elements that explicitly support Star unit types.

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

[<Sealed>]
[<TypeConverterAttribute(typeof(GridLengthConverter))>]
type GridLength =  
    struct 
        interface IEquatable<GridLength>
    end
<object property="doubleLength"/>
- or -
<object property="autoValue"/>

XAML Values

doubleLength

The element’s length, described as either a Double value that specifies a device-independent units (1/96th inch per unit) measure, or as a qualifiedDouble (see below).

autoValue

The element's length, described by either the value Auto or *. See GridUnitType for more information on the values Auto and *.

qualifiedDouble

A double value as described above for any of the measures, followed by one of the following unit declaration strings: px, in, cm, pt.

px (default) is device-independent units (1/96th inch per unit)

in is inches; 1in==96px

cm is centimeters; 1cm==(96/2.54) px

pt is points; 1pt==(96/72) px

The GridLength type exposes the following members.

  NameDescription
Public methodGridLength(Double)Initializes a new instance of the GridLength structure using the specified absolute value in pixels.
Public methodGridLength(Double, GridUnitType)Initializes a new instance of the GridLength structure and specifies what kind of value it holds.
Top

  NameDescription
Public propertyStatic memberAutoGets an instance of GridLength that holds a value whose size is determined by the size properties of the content object.
Public propertyGridUnitTypeGets the associated GridUnitType for the GridLength.
Public propertyIsAbsoluteGets a value that indicates whether the GridLength holds a value that is expressed in pixels.
Public propertyIsAutoGets a value that indicates whether the GridLength holds a value whose size is determined by the size properties of the content object.
Public propertyIsStarGets a value that indicates whether the GridLength holds a value that is expressed as a weighted proportion of available space.
Public propertyValueGets a Double that represents the value of the GridLength.
Top

  NameDescription
Public methodEquals(GridLength)Determines whether the specified GridLength is equal to the current GridLength.
Public methodEquals(Object)Determines whether the specified object is equal to the current GridLength instance. (Overrides ValueType.Equals(Object).)
Public methodGetHashCodeGets a hash code for the GridLength. (Overrides ValueType.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a String representation of the GridLength. (Overrides ValueType.ToString().)
Top

  NameDescription
Public operatorStatic memberEqualityCompares two GridLength structures for equality.
Public operatorStatic memberInequalityCompares two GridLength structures to determine if they are not equal.
Top

Elements such as ColumnDefinition and RowDefinition use this type to describe width and height in order to support variable distribution of available space.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft