Thickness

The thickness of a frame around a rectangle, as used for margins and padding.
public readonly record struct Thickness(double Left, double Top, double Right, double Bottom)

Constructors

Creates a uniform thickness: all four sides use the same value.

public Thickness(
  double uniform)
ParameterSummary
double uniformThe thickness value for all four sides.

Creates a symmetric thickness: horizontal for left/right, vertical for top/bottom.

public Thickness(
  double horizontal,
  double vertical)
ParameterSummary
double horizontalThe thickness for the left and right sides.
double verticalThe thickness for the top and bottom sides.

Initializes a new instance of the Thickness struct.

public Thickness(
  double Left,
  double Top,
  double Right,
  double Bottom)
ParameterSummary
double LeftThe thickness on the left side.
double TopThe thickness on the top side.
double RightThe thickness on the right side.
double BottomThe thickness on the bottom side.

Properties

Bottom

The thickness on the bottom side.

Type: double

public double Bottom { get; init; }

Horizontal

The total thickness on the horizontal axis (Left + Right).

Type: double

public double Horizontal { get; }

Left

The thickness on the left side.

Type: double

public double Left { get; init; }

The thickness on the right side.

Type: double

public double Right { get; init; }

Top

The thickness on the top side.

Type: double

public double Top { get; init; }

Vertical

The total thickness on the vertical axis (Top + Bottom).

Type: double

public double Vertical { get; }

Fields

Zero

A thickness of zero on all sides.

Type: Thickness

public static readonly Thickness Zero

Operators

Implicit Thickness(double)

Creates a uniform thickness from a single numeric value.

public static implicit operator Thickness(
  double uniform)
ParameterSummary
double uniformThe uniform thickness value.

Returns