Struct Thickness
- Namespace
- Avalonia
- Assembly
- Avalonia.Base.dll
Describes the thickness of a frame around a rectangle.
public readonly struct Thickness : IEquatable<Thickness>
- Implements
- Inherited Members
Constructors
Thickness(double)
Initializes a new instance of the Thickness structure.
public Thickness(double uniformLength)
Parameters
uniformLength
doubleThe length that should be applied to all sides.
Thickness(double, double)
Initializes a new instance of the Thickness structure.
public Thickness(double horizontal, double vertical)
Parameters
horizontal
doubleThe thickness on the left and right.
vertical
doubleThe thickness on the top and bottom.
Thickness(double, double, double, double)
Initializes a new instance of the Thickness structure.
public Thickness(double left, double top, double right, double bottom)
Parameters
left
doubleThe thickness on the left.
top
doubleThe thickness on the top.
right
doubleThe thickness on the right.
bottom
doubleThe thickness on the bottom.
Properties
Bottom
Gets the thickness on the bottom.
public double Bottom { get; }
Property Value
IsUniform
Gets a value indicating whether all sides are equal.
public bool IsUniform { get; }
Property Value
Left
Gets the thickness on the left.
public double Left { get; }
Property Value
Right
Gets the thickness on the right.
public double Right { get; }
Property Value
Top
Gets the thickness on the top.
public double Top { get; }
Property Value
Methods
Deconstruct(out double, out double, out double, out double)
Deconstructor the thickness into its left, top, right and bottom thickness values.
public void Deconstruct(out double left, out double top, out double right, out double bottom)
Parameters
left
doubleThe thickness on the left.
top
doubleThe thickness on the top.
right
doubleThe thickness on the right.
bottom
doubleThe thickness on the bottom.
Equals(Thickness)
Returns a boolean indicating whether the thickness is equal to the other given point.
public bool Equals(Thickness other)
Parameters
other
ThicknessThe other thickness to test equality against.
Returns
- bool
True if this thickness is equal to other; False otherwise.
Equals(object?)
Checks for equality between a thickness and an object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object.
Returns
- bool
True if
obj
is a size that equals the current size.
GetHashCode()
Returns a hash code for a Thickness.
public override int GetHashCode()
Returns
- int
The hash code.
Parse(string)
Parses a Thickness string.
public static Thickness Parse(string s)
Parameters
s
stringThe string.
Returns
ToString()
Returns the string representation of the thickness.
public override string ToString()
Returns
- string
The string representation of the thickness.
Operators
operator +(Size, Thickness)
Adds a Thickness to a Size.
public static Size operator +(Size size, Thickness thickness)
Parameters
Returns
- Size
The equality.
operator +(Thickness, Thickness)
Adds two Thicknesses.
public static Thickness operator +(Thickness a, Thickness b)
Parameters
Returns
- Thickness
The equality.
operator ==(Thickness, Thickness)
Compares two Thicknesses.
public static bool operator ==(Thickness a, Thickness b)
Parameters
Returns
- bool
The equality.
operator !=(Thickness, Thickness)
Compares two Thicknesses.
public static bool operator !=(Thickness a, Thickness b)
Parameters
Returns
- bool
The inequality.
operator *(Thickness, double)
Multiplies a Thickness to a scalar.
public static Thickness operator *(Thickness a, double b)
Parameters
Returns
- Thickness
The equality.
operator -(Size, Thickness)
Subtracts a Thickness from a Size.
public static Size operator -(Size size, Thickness thickness)
Parameters
Returns
- Size
The equality.
operator -(Thickness, Thickness)
Subtracts two Thicknesses.
public static Thickness operator -(Thickness a, Thickness b)
Parameters
Returns
- Thickness
The equality.