Constructor GridLength
GridLength(double)
Initializes a new instance of the GridLength struct as an absolute value in pixels.
public GridLength(double pixels)
Parameters
pixelsdoubleSpecifies the number of 'device-independent pixels' (96 pixels-per-inch).
Exceptions
- ArgumentException
If
pixelsparameter isCoord.NaNorpixelsparameter isCoord.NegativeInfinityorpixelsparameter isCoord.PositiveInfinity.
GridLength(double, GridUnitType)
Initializes a new instance of the GridLength struct and specifies what kind of value it will hold.
public GridLength(double value = 0, GridUnitType type = GridUnitType.Auto)
Parameters
valuedoubleValue to be stored by this GridLength instance.
typeGridUnitTypeType of the value to be stored by this GridLength instance.
Remarks
If the type parameter is GridUnitType.Auto,
then passed in value is ignored and replaced with 1.
Exceptions
- ArgumentException
If
valueparameter is invinity or is not a number.