Struct GridLength
Holds the width or height of a Grid's column and row definitions.
public struct GridLength : IEquatable<GridLength>
- Implements
- Inherited Members
Constructors
GridLength(double)
Initializes a new instance of the GridLength struct.
public GridLength(double value)
Parameters
value
doubleThe size of the GridLength in device independent pixels.
GridLength(double, GridUnitType)
Initializes a new instance of the GridLength struct.
public GridLength(double value, GridUnitType type)
Parameters
value
doubleThe size of the GridLength.
type
GridUnitTypeThe unit of the GridLength.
Properties
Auto
Gets an instance of GridLength that indicates that a row or column should auto-size to fit its content.
public static GridLength Auto { get; }
Property Value
GridUnitType
Gets the unit of the GridLength.
public GridUnitType GridUnitType { get; }
Property Value
IsAbsolute
Gets a value that indicates whether the GridLength has a GridUnitType of Pixel.
public bool IsAbsolute { get; }
Property Value
IsAuto
Gets a value that indicates whether the GridLength has a GridUnitType of Auto.
public bool IsAuto { get; }
Property Value
IsStar
Gets a value that indicates whether the GridLength has a GridUnitType of Star.
public bool IsStar { get; }
Property Value
Star
Gets an instance of GridLength that indicates that a row or column should fill its content.
public static GridLength Star { get; }
Property Value
Value
Gets the length.
public double Value { get; }
Property Value
Methods
Equals(GridLength)
Compares two GridLength structures for equality.
public bool Equals(GridLength gridLength)
Parameters
gridLength
GridLengthThe structure with which to test equality.
Returns
- bool
True if the structures are equal, otherwise false.
Equals(object?)
Determines whether the GridLength is equal to the specified object.
public override bool Equals(object? o)
Parameters
o
objectThe object with which to test equality.
Returns
- bool
True if the objects are equal, otherwise false.
GetHashCode()
Gets a hash code for the GridLength.
public override int GetHashCode()
Returns
- int
The hash code.
Parse(string)
Parses a string to return a GridLength.
public static GridLength Parse(string s)
Parameters
s
stringThe string.
Returns
- GridLength
The GridLength.
ParseLengths(string)
Parses a string to return a collection of GridLengths.
public static IEnumerable<GridLength> ParseLengths(string s)
Parameters
s
stringThe string.
Returns
- IEnumerable<GridLength>
The GridLength.
ToString()
Gets a string representation of the GridLength.
public override string ToString()
Returns
- string
The string representation.
Operators
operator ==(GridLength, GridLength)
Compares two GridLength structures for equality.
public static bool operator ==(GridLength a, GridLength b)
Parameters
a
GridLengthThe first GridLength.
b
GridLengthThe second GridLength.
Returns
- bool
True if the structures are equal, otherwise false.
operator !=(GridLength, GridLength)
Compares two GridLength structures for inequality.
public static bool operator !=(GridLength gl1, GridLength gl2)
Parameters
gl1
GridLengthThe first GridLength.
gl2
GridLengthThe first GridLength.
Returns
- bool
True if the structures are unequal, otherwise false.