Table of Contents

Struct RelativeScalar

Namespace
Avalonia
Assembly
Avalonia.Base.dll

Defines a scalar value that may be defined relative to a containing element.

public struct RelativeScalar : IEquatable<RelativeScalar>
Implements
Inherited Members

Constructors

RelativeScalar(double, RelativeUnit)

Initializes a new instance of the RelativeScalar struct.

public RelativeScalar(double scalar, RelativeUnit unit)

Parameters

scalar double

The scalar value.

unit RelativeUnit

The unit.

Properties

Beginning

The value at the beginning of the range

public static RelativeScalar Beginning { get; }

Property Value

RelativeScalar

End

The value at the end of the range

public static RelativeScalar End { get; }

Property Value

RelativeScalar

Middle

The value at the middle of the range

public static RelativeScalar Middle { get; }

Property Value

RelativeScalar

Scalar

Gets the scalar.

public double Scalar { get; }

Property Value

double

Unit

Gets the unit.

public RelativeUnit Unit { get; }

Property Value

RelativeUnit

Methods

Equals(RelativeScalar)

public bool Equals(RelativeScalar other)

Parameters

other RelativeScalar

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Parse(string)

Parses a RelativeScalar string.

public static RelativeScalar Parse(string s)

Parameters

s string

The string.

Returns

RelativeScalar

The parsed RelativeScalar.

ToString()

Returns a String representing this RelativeScalar instance.

public override string ToString()

Returns

string

The string representation.

ToValue(double)

Converts a RelativeScalar into a final value.

public double ToValue(double size)

Parameters

size double

Returns

double

The origin point in pixels.

Operators

operator ==(RelativeScalar, RelativeScalar)

public static bool operator ==(RelativeScalar left, RelativeScalar right)

Parameters

left RelativeScalar
right RelativeScalar

Returns

bool

operator !=(RelativeScalar, RelativeScalar)

public static bool operator !=(RelativeScalar left, RelativeScalar right)

Parameters

left RelativeScalar
right RelativeScalar

Returns

bool