Skip to main content

Thickness Struct

Definition

Namespace:Avalonia
Assembly:Avalonia.Base
Package:Avalonia

Describes the thickness of a frame around a rectangle.

public struct Thickness

Inheritance: ValueType -> Thickness

Implements: IEquatable<Thickness>

Constructors

NameDescription
Thickness (3 overloads)Initializes a new instance of the Avalonia.Thickness structure.

Thickness overloads

Thickness Constructor

Initializes a new instance of the Avalonia.Thickness structure.

public Thickness(double uniformLength)
Parameters

uniformLength double

The length that should be applied to all sides.

Thickness Constructor

Initializes a new instance of the Avalonia.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 Constructor

Initializes a new instance of the Avalonia.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.

Methods

NameDescription
DeconstructNo summary available.
Equals (2 overloads)Returns a boolean indicating whether the thickness is equal to the other given point.
GetHashCodeReturns a hash code for a Avalonia.Thickness.
ParseParses a Avalonia.Thickness string.
ToStringReturns the string representation of the thickness.

Deconstruct Method

public void Deconstruct(double& left, double& top, double& right, double& bottom)

Parameters

left double&

top double&

right double&

bottom double&

Equals overloads

Equals Method

Returns a boolean indicating whether the thickness is equal to the other given point.

public bool Equals(Avalonia.Thickness other)
Parameters

other Avalonia.Thickness

The other thickness to test equality against.

Returns

bool

True if this thickness is equal to other; False otherwise.

Equals Method

Checks for equality between a thickness and an object.

public bool Equals(object obj)
Parameters

obj object

The object.

Returns

bool

True if obj is a size that equals the current size.

GetHashCode Method

Returns a hash code for a Avalonia.Thickness.

public int GetHashCode()

Returns

int

The hash code.

Parse Method

Parses a Avalonia.Thickness string.

public Avalonia.Thickness Parse(string s)

Parameters

s string

The string.

Returns

Avalonia.Thickness

The Avalonia.Thickness.

ToString Method

Returns the string representation of the thickness.

public string ToString()

Returns

string

The string representation of the thickness.

Properties

NameDescription
BottomGets the thickness on the bottom.
IsUniformGets a value indicating whether all sides are equal.
LeftGets the thickness on the left.
RightGets the thickness on the right.
TopGets the thickness on the top.

Bottom Property

Gets the thickness on the bottom.

public double Bottom { get; set; }

IsUniform Property

Gets a value indicating whether all sides are equal.

public bool IsUniform { get; set; }

Left Property

Gets the thickness on the left.

public double Left { get; set; }

Right Property

Gets the thickness on the right.

public double Right { get; set; }

Top Property

Gets the thickness on the top.

public double Top { get; set; }