GridLength

The size of a grid row or column: absolute (points), auto-sized, or a weighted star share.
public readonly record struct GridLength

Properties

IsAbsolute

True for a GridUnitType.Pixel track.

Type: bool

public bool IsAbsolute { get; }

IsAuto

True for an GridUnitType.Auto track.

Type: bool

public bool IsAuto { get; }

IsStar

True for a GridUnitType.Star track.

Type: bool

public bool IsStar { get; }

Type

How Value is interpreted.

Type: GridUnitType

public GridUnitType Type { get; }

Value

Points for a pixel track, the weight for a star track, ignored for auto.

Type: double

public double Value { get; }

Methods

Pixels

A fixed track of points points.

public static GridLength Pixels(
  double points)
ParameterSummary
double pointsThe fixed size in layout points.

Returns

  • GridLength: A new fixed-size grid length configuration.

Stars

A star track with the given weight of the remaining space.

public static GridLength Stars(
  double weight)
ParameterSummary
double weightThe proportional allocation factor.

Returns

  • GridLength: A new proportional grid length configuration.

Fields

Auto

An auto-sized track.

Type: GridLength

public static readonly GridLength Auto

Star

A single star track (weight 1).

Type: GridLength

public static readonly GridLength Star

Operators

Implicit GridLength(double)

A fixed track from a point value (so Columns = { 200, GridLength.Star } compiles).

public static implicit operator GridLength(
  double points)
ParameterSummary
double pointsThe absolute size in layout points.

Returns