Table of Contents

Struct SizeValue

Namespace
Nalu.MagnetLayout
Assembly
Nalu.Maui.Layouts.dll

Represents a fixed or percentage size value.

public readonly record struct SizeValue : IEquatable<SizeValue>
Implements
Inherited Members

Constructors

SizeValue(double, SizeUnit, SizeBehavior)

Represents a fixed or percentage size value.

public SizeValue(double Value, SizeUnit Unit = SizeUnit.Measured, SizeBehavior Behavior = SizeBehavior.Required)

Parameters

Value double
Unit SizeUnit
Behavior SizeBehavior

Fields

Default

Matches the measured size.

public static readonly SizeValue Default

Field Value

SizeValue

Shrink

Matches the measured size, but can shrink if needed.

public static readonly SizeValue Shrink

Field Value

SizeValue

Properties

Behavior

public SizeBehavior Behavior { get; init; }

Property Value

SizeBehavior

Unit

public SizeUnit Unit { get; init; }

Property Value

SizeUnit

Value

public double Value { get; init; }

Property Value

double

Methods

Constraint(double, SizeBehavior)

Implicitly converts a Constraint coefficient to a SizeValue.

public static SizeValue Constraint(double value, SizeBehavior behavior = SizeBehavior.Required)

Parameters

value double
behavior SizeBehavior

Returns

SizeValue

Measured(double, SizeBehavior)

Implicitly converts a Measured coefficient SizeValue.

public static SizeValue Measured(double value, SizeBehavior behavior = SizeBehavior.Required)

Parameters

value double
behavior SizeBehavior

Returns

SizeValue

Ratio(double, SizeBehavior)

Implicitly converts a Ratio coefficient to a SizeValue.

public static SizeValue Ratio(double value, SizeBehavior behavior = SizeBehavior.Required)

Parameters

value double
behavior SizeBehavior

Returns

SizeValue

StagePercent(double, SizeBehavior)

Implicitly converts a Stage percentage to a SizeValue coefficient.

public static SizeValue StagePercent(double percent, SizeBehavior behavior = SizeBehavior.Required)

Parameters

percent double
behavior SizeBehavior

Returns

SizeValue

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

implicit operator SizeValue(string)

Implicitly converts a string representation (e.g., "50%" or "*" or "1-") into a SizeValue.

public static implicit operator SizeValue(string inputString)

Parameters

inputString string

Returns

SizeValue