struct Length
A variable unit based length. ie, could be a percentage or a pixel length. This is commonly used to express the size of things in UI space, usually coming from style sheets.
public float Value
The meaning of the value is dependent on .
public LengthUnit Unit
How to determine the final length. Commonly used with Pixel or Percentage.
public float GetPixels( float dimension )
Convert to a pixel value. Use the dimension to work out percentage values.
public float GetPixels( float dimension, float contentSize )
Get the pixel size but also evaluate content size to support use Start, End, Center
public static Nullable<Length> Pixels( float pixels )
Create a length in pixels
pixelsThe amount of pixels for this length- Returns A new length
public static Nullable<Length> Percent( float percent )
Create a length in percents
percentThe amount of percent for this (0-100)- Returns A new length
public static Nullable<Length> ViewHeight( float percentage )
Create a length based on the view height
percentageThe amount of percent for this (0-100)- Returns A new length
public static Nullable<Length> ViewWidth( float percentage )
Create a length based on the view width
percentageThe amount of percent for this (0-100)- Returns A new length
public static Nullable<Length> ViewMax( float percentage )
Create a length based on the longest edge of the screen size
percentageThe amount of percent for this (0-100)- Returns A new length
public static Nullable<Length> ViewMin( float percentage )
Create a length based on the shortest edge of the screen size
percentageThe amount of percent for this (0-100)- Returns A new length
public static Nullable<Length> Fraction( float fraction )
Create a length in percents
fractionThe fraction of a percent (0 = 0%, 1 = 100%)- Returns A new length
public static Nullable<Length> Calc( string expression )
Create a length based on a css calc expression
public static Length Rem( float value )
Create a length based on the font size of the root element.
valueValue in rem- Returns A new length
public static Length Em( float value )
Create a length based on the font size of the current element.
valueValue in em- Returns A new length
public static Length Auto { get; }
Quickly create a Length with Unit set to LengthUnit.Auto
public static Length Contain { get; }
Quickly create a Length with Unit set to LengthUnit.Contain
public static Length Cover { get; }
Quickly create a Length with Unit set to LengthUnit.Cover
public static Nullable<Length> Parse( string value )
Parse a length. This is used by the stylesheet parsing system.
valueA length represented by a string
public static Length op_Implicit( float value )
😔 No documentation found.
public static Length Undefined { get; }
😔 No documentation found.
public bool Equals( Length other )
😔 No documentation found.
public static bool op_Equality( Length lhs, Length rhs )
😔 No documentation found.
public static bool op_Inequality( Length lhs, Length rhs )
😔 No documentation found.
public static bool op_Equality( Nullable<Length> lhs, Nullable<Length> rhs )
😔 No documentation found.
public static bool op_Inequality( Nullable<Length> lhs, Nullable<Length> rhs )
😔 No documentation found.
public string ToString( )
😔 No documentation found.
public Type GetType( )
😔 No documentation found.
public int GetHashCode( )
😔 No documentation found.
public bool Equals( object obj )
😔 No documentation found.