Show / Hide Table of Contents

Struct Thickness

Describes the thickness of a frame around a rectangle. Four System.Double values describe the Left, Top, Right, and Bottom sides of the rectangle, respectively.

Implements
System.IEquatable<Thickness>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public struct Thickness : IEquatable<Thickness>

Constructors

| Improve this Doc View Source

Thickness(Double)

Initializes a Thickness structure that has the specified uniform length on each side.

Declaration
public Thickness(double uniformLength)
Parameters
Type Name Description
System.Double uniformLength

The uniform length applied to all four sides of the bounding rectangle.

| Improve this Doc View Source

Thickness(Double, Double, Double, Double)

Initializes a Thickness structure that has specific lengths (supplied as a System.Double) applied to each side of the rectangle.

Declaration
public Thickness(double left, double top, double right, double bottom)
Parameters
Type Name Description
System.Double left

The thickness for the left side of the rectangle.

System.Double top

The thickness for the upper side of the rectangle.

System.Double right

The thickness for the right side of the rectangle

System.Double bottom

The thickness for the lower side of the rectangle.

Properties

| Improve this Doc View Source

Bottom

Gets or sets the width, in pixels, of the lower side of the bounding rectangle.

Declaration
public double Bottom { readonly get; set; }
Property Value
Type Description
System.Double

A System.Double that represents the width, in pixels, of the lower side of the bounding rectangle for this instance of Thickness. The default is 0.

| Improve this Doc View Source

Left

Gets or sets the width, in pixels, of the left side of the bounding rectangle.

Declaration
public double Left { readonly get; set; }
Property Value
Type Description
System.Double

A System.Double that represents the width, in pixels, of the left side of the bounding rectangle for this instance of Thickness. The default is 0.

| Improve this Doc View Source

Right

Gets or sets the width, in pixels, of the right side of the bounding rectangle.

Declaration
public double Right { readonly get; set; }
Property Value
Type Description
System.Double

A System.Double that represents the width, in pixels, of the right side of the bounding rectangle for this instance of Thickness. The default is 0.

| Improve this Doc View Source

Top

Gets or sets the width, in pixels, of the upper side of the bounding rectangle.

Declaration
public double Top { readonly get; set; }
Property Value
Type Description
System.Double

A System.Double that represents the width, in pixels, of the upper side of the bounding rectangle for this instance of Thickness. The default is 0.

Methods

| Improve this Doc View Source

Equals(Object)

Compares this Thickness structure to another System.Object for equality.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The object to compare.

Returns
Type Description
System.Boolean

true if the two objects are equal; otherwise, false.

Overrides
System.ValueType.Equals(System.Object)
| Improve this Doc View Source

Equals(Thickness)

Compares this Thickness structure to another Thickness structure for equality.

Declaration
public bool Equals(Thickness thickness)
Parameters
Type Name Description
Thickness thickness

An instance of Thickness to compare for equality.

Returns
Type Description
System.Boolean

true if the two instances of Thickness are equal; otherwise, false.

| Improve this Doc View Source

GetHashCode()

Returns the hash code of the structure.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A hash code for this instance of Thickness.

Overrides
System.ValueType.GetHashCode()
| Improve this Doc View Source

ToString()

Returns the string representation of the Thickness structure.

Declaration
public override string ToString()
Returns
Type Description
System.String

A System.String that represents the Thickness value.

Overrides
System.ValueType.ToString()

Operators

| Improve this Doc View Source

Equality(Thickness, Thickness)

Compares the value of two Thickness structures for equality.

Declaration
public static bool operator ==(Thickness t1, Thickness t2)
Parameters
Type Name Description
Thickness t1

The first structure to compare.

Thickness t2

The other structure to compare.

Returns
Type Description
System.Boolean

true if the two instances of Thickness are equal; otherwise, false.

| Improve this Doc View Source

Inequality(Thickness, Thickness)

Compares two Thickness structures for inequality.

Declaration
public static bool operator !=(Thickness t1, Thickness t2)
Parameters
Type Name Description
Thickness t1

The first structure to compare.

Thickness t2

The other structure to compare.

Returns
Type Description
System.Boolean

true if the two instances of Thickness are not equal; otherwise, false.

Implements

System.IEquatable<T>
  • Improve this Doc
  • View Source