Table of Contents

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 double

The 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 double

The thickness on the left and right.

vertical double

The 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 double

The thickness on the left.

top double

The thickness on the top.

right double

The thickness on the right.

bottom double

The thickness on the bottom.

Properties

Bottom

Gets the thickness on the bottom.

public double Bottom { get; }

Property Value

double

IsUniform

Gets a value indicating whether all sides are equal.

public bool IsUniform { get; }

Property Value

bool

Left

Gets the thickness on the left.

public double Left { get; }

Property Value

double

Right

Gets the thickness on the right.

public double Right { get; }

Property Value

double

Top

Gets the thickness on the top.

public double Top { get; }

Property Value

double

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 double

The thickness on the left.

top double

The thickness on the top.

right double

The thickness on the right.

bottom double

The 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 Thickness

The 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 object

The 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 string

The string.

Returns

Thickness

The Thickness.

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

size Size

The size.

thickness Thickness

The thickness.

Returns

Size

The equality.

operator +(Thickness, Thickness)

Adds two Thicknesses.

public static Thickness operator +(Thickness a, Thickness b)

Parameters

a Thickness

The first thickness.

b Thickness

The second thickness.

Returns

Thickness

The equality.

operator ==(Thickness, Thickness)

Compares two Thicknesses.

public static bool operator ==(Thickness a, Thickness b)

Parameters

a Thickness

The first thickness.

b Thickness

The second thickness.

Returns

bool

The equality.

operator !=(Thickness, Thickness)

Compares two Thicknesses.

public static bool operator !=(Thickness a, Thickness b)

Parameters

a Thickness

The first thickness.

b Thickness

The second thickness.

Returns

bool

The inequality.

operator *(Thickness, double)

Multiplies a Thickness to a scalar.

public static Thickness operator *(Thickness a, double b)

Parameters

a Thickness

The thickness.

b double

The scalar.

Returns

Thickness

The equality.

operator -(Size, Thickness)

Subtracts a Thickness from a Size.

public static Size operator -(Size size, Thickness thickness)

Parameters

size Size

The size.

thickness Thickness

The thickness.

Returns

Size

The equality.

operator -(Thickness, Thickness)

Subtracts two Thicknesses.

public static Thickness operator -(Thickness a, Thickness b)

Parameters

a Thickness

The first thickness.

b Thickness

The second thickness.

Returns

Thickness

The equality.