Skip to main content

RelativeScalar Struct

Definition

Namespace:Avalonia
Assembly:Avalonia.Base
Package:Avalonia

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

public struct RelativeScalar

Inheritance: ValueType -> RelativeScalar

Implements: IEquatable<RelativeScalar>

Constructors

NameDescription
RelativeScalarInitializes a new instance of the Avalonia.RelativeScalar struct.

RelativeScalar Constructor

Initializes a new instance of the Avalonia.RelativeScalar struct.

public RelativeScalar(double scalar, Avalonia.RelativeUnit unit)

Parameters

scalar double

The scalar value.

unit Avalonia.RelativeUnit

The unit.

Methods

NameDescription
Equals (2 overloads)No summary available.
GetHashCodeNo summary available.
ParseParses a Avalonia.RelativeScalar string.
ToStringReturns a String representing this RelativeScalar instance.
ToValueConverts a Avalonia.RelativeScalar into a final value.

Equals overloads

Equals Method

public bool Equals(Avalonia.RelativeScalar other)
Parameters

other Avalonia.RelativeScalar

Returns

bool

Equals Method

public bool Equals(object obj)
Parameters

obj object

Returns

bool

GetHashCode Method

public int GetHashCode()

Returns

int

Parse Method

Parses a Avalonia.RelativeScalar string.

public Avalonia.RelativeScalar Parse(string s)

Parameters

s string

The string.

Returns

Avalonia.RelativeScalar

The parsed Avalonia.RelativeScalar.

ToString Method

Returns a String representing this RelativeScalar instance.

public string ToString()

Returns

string

The string representation.

ToValue Method

Converts a Avalonia.RelativeScalar into a final value.

public double ToValue(double size)

Parameters

size double

Returns

double

The origin point in pixels.

Properties

NameDescription
BeginningThe value at the beginning of the range
EndThe value at the end of the range
MiddleThe value at the middle of the range
ScalarGets the scalar.
UnitGets the unit.

Beginning Property

The value at the beginning of the range

public Avalonia.RelativeScalar Beginning { get; set; }

End Property

The value at the end of the range

public Avalonia.RelativeScalar End { get; set; }

Middle Property

The value at the middle of the range

public Avalonia.RelativeScalar Middle { get; set; }

Scalar Property

Gets the scalar.

public double Scalar { get; set; }

Unit Property

Gets the unit.

public Avalonia.RelativeUnit Unit { get; set; }