Skip to content

GridLength.UnitType

property · GridLength · cAlgo.API

DesktopCLICloud

Gets or sets the type of the unit.

Definition

public GridUnitType UnitType {get;}
gridLength.UnitType: GridUnitType

Returns GridUnitType

Examples

var grid = new Grid(2, 1);
grid.Rows[0].SetHeightInStars(2);
var height = grid.Rows[0].Height;
if (height.UnitType == GridUnitType.Star)
    Print("Row takes {0} stars", height.Value);
grid = Grid(2, 1)
grid.Rows[0].SetHeightInStars(2)
height = grid.Rows[0].Height
if height.UnitType == GridUnitType.Star:
    api.Print(f"Row takes {height.Value} stars")