The ViewHeight
field of the LengthUnit
enumeration represents a length unit that is a percentage (0-100) of the viewport's height. This unit is useful for responsive design, allowing elements to scale based on the height of the user's viewport.
The ViewHeight
field of the LengthUnit
enumeration represents a length unit that is a percentage (0-100) of the viewport's height. This unit is useful for responsive design, allowing elements to scale based on the height of the user's viewport.
Use LengthUnit.ViewHeight
when you want to specify a length that is relative to the height of the viewport. This is particularly useful for creating responsive layouts that adapt to different screen sizes.
// Example of using LengthUnit.ViewHeight in a UI component var myElement = new UIElement(); myElement.Style.Height = new Length(50, LengthUnit.ViewHeight); // Sets the height to 50% of the viewport's height