StyleLength struct Core

A length in an ArionStyle (a radius, a font size, a blur): a fixed number of logical units, or a theme token (Tokens.FontBody) read at draw time. A number converts implicitly.

public readonly struct StyleLength : IEquatable<StyleLength>
Namespace
ArionUI.Presentation.Controls
Package
ArionUI.Presentation · dotnet add package ArionUI.Presentation --prerelease
Implements
IEquatable<StyleLength>

Properties

Token

public string? Token { get; }

The token's name ("font-body"); null for a fixed length.

Methods

Equals

public override bool Equals(object? obj);

Equals

public bool Equals(StyleLength other);

FromToken

public static StyleLength FromToken(string name, Func<ArionTheme, double> read);

A named theme length, read from the theme at draw time.

Parameters

name

The token's name, as a text form would spell it.

read

Reads the length from a theme.

GetHashCode

public override int GetHashCode();

Resolve

public double Resolve(ArionTheme theme);

The length under theme.

ToString

public override string ToString();

The token's name, or the number.

Operators

operator !=

public static bool operator !=(StyleLength left, StyleLength right);

Different lengths or tokens.

operator ==

public static bool operator ==(StyleLength left, StyleLength right);

Equal lengths or equal tokens.

operator implicit

public static implicit operator StyleLength(double units);

A fixed length in logical units.