Struct GridLength
Represents the length of elements that explicitly support Star unit types.
Inherited Members
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public struct GridLength
Constructors
| Improve this Doc View SourceGridLength(Double)
Initializes a new instance of the GridLength structure using the specified absolute value in pixels.
Declaration
public GridLength(double pixels)
Parameters
Type | Name | Description |
---|---|---|
System.Double | pixels | The absolute count of pixels to establish as the value. |
GridLength(Double, GridUnitType)
Initializes a new instance of the GridLength structure and specifies what kind of value it holds.
Declaration
public GridLength(double value, GridUnitType type)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The initial value of this instance of GridLength. |
GridUnitType | type | The GridUnitType held by this instance of GridLength. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | value is less than 0 or is not a number.- or -type is not a valid GridUnitType. |
Properties
| Improve this Doc View SourceAuto
Gets an instance of GridLength that holds a value whose size is determined by the size properties of the content object.
Declaration
public static readonly GridLength Auto { get; }
Property Value
Type | Description |
---|---|
GridLength | A instance of GridLength whose GridUnitType property is set to Auto. |
GridUnitType
Gets the associated GridUnitType for the GridLength.
Declaration
public readonly GridUnitType GridUnitType { get; }
Property Value
Type | Description |
---|---|
GridUnitType | One of the GridUnitType values. The default is Auto. |
IsAbsolute
Gets a value that indicates whether the GridLength holds a value that is expressed in pixels.
Declaration
public readonly bool IsAbsolute { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the GridUnitType property is Pixel; otherwise, false. |
IsAuto
Gets a value that indicates whether the GridLength holds a value whose size is determined by the size properties of the content object.
Declaration
public readonly bool IsAuto { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the GridUnitType property is Auto; otherwise, false. |
IsStar
Gets a value that indicates whether the GridLength holds a value that is expressed as a weighted proportion of available space.
Declaration
public readonly bool IsStar { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the GridUnitType property is Star; otherwise, false. |
Value
Gets a System.Double that represents the value of the GridLength.
Declaration
public readonly double Value { get; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double that represents the value of the current instance. |
Methods
| Improve this Doc View SourceClone()
Get a copy of the current instance of GridLength.
Declaration
public GridLength Clone()
Returns
Type | Description |
---|---|
GridLength |
Equals(Object)
Determines whether the specified object is equal to the current GridLength instance.
Declaration
public override bool Equals(object oCompare)
Parameters
Type | Name | Description |
---|---|---|
System.Object | oCompare | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified object has the same value and GridUnitType as the current instance; otherwise, false. |
Overrides
Equals(GridLength)
Determines whether the specified GridLength is equal to the current GridLength.
Declaration
public bool Equals(GridLength gridLength)
Parameters
Type | Name | Description |
---|---|---|
GridLength | gridLength | The GridLength structure to compare with the current instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified GridLength has the same value and GridUnitType as the current instance; otherwise, false. |
GetHashCode()
Gets a hash code for the GridLength.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the GridLength. |
Overrides
ToString()
Returns a System.String representation of the GridLength.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String representation of the current GridLength structure. |
Overrides
Operators
| Improve this Doc View SourceEquality(GridLength, GridLength)
Compares two GridLength structures for equality.
Declaration
public static bool operator ==(GridLength gl1, GridLength gl2)
Parameters
Type | Name | Description |
---|---|---|
GridLength | gl1 | The first instance of GridLength to compare. |
GridLength | gl2 | The second instance of GridLength to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if the two instances of GridLength have the same value and GridUnitType; otherwise, false. |
Inequality(GridLength, GridLength)
Compares two GridLength structures to determine if they are not equal.
Declaration
public static bool operator !=(GridLength gl1, GridLength gl2)
Parameters
Type | Name | Description |
---|---|---|
GridLength | gl1 | The first instance of GridLength to compare. |
GridLength | gl2 | The second instance of GridLength to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if the two instances of GridLength do not have the same value and GridUnitType; otherwise, false. |