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
doubleThe scalar value.
unit
RelativeUnitThe unit.
Properties
Beginning
The value at the beginning of the range
public static RelativeScalar Beginning { get; }
Property Value
End
The value at the end of the range
public static RelativeScalar End { get; }
Property Value
Middle
The value at the middle of the range
public static RelativeScalar Middle { get; }
Property Value
Scalar
Gets the scalar.
public double Scalar { get; }
Property Value
Unit
Gets the unit.
public RelativeUnit Unit { get; }
Property Value
Methods
Equals(RelativeScalar)
public bool Equals(RelativeScalar other)
Parameters
other
RelativeScalar
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
Parse(string)
Parses a RelativeScalar string.
public static RelativeScalar Parse(string s)
Parameters
s
stringThe 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
RelativeScalarright
RelativeScalar
Returns
operator !=(RelativeScalar, RelativeScalar)
public static bool operator !=(RelativeScalar left, RelativeScalar right)
Parameters
left
RelativeScalarright
RelativeScalar