Align

Represents a renderable used to align content.

Represents a renderable used to align content.

Constructors

public Align(IRenderable renderable, HorizontalAlignment horizontal, VerticalAlignment? vertical = default)

Initializes a new instance of the Align class.

Parameters:

renderable (IRenderable)
The renderable to align.
horizontal (HorizontalAlignment)
The horizontal alignment.
vertical (VerticalAlignment?)
The vertical alignment, or null if none.

Properties

Height : int?

Gets or sets the height.

Horizontal : HorizontalAlignment

Gets or sets the horizontal alignment.

Vertical : VerticalAlignment?

Gets or sets the vertical alignment.

Width : int?

Gets or sets the width.

Methods

public static Align Center(IRenderable renderable, VerticalAlignment? vertical = default)

Initializes a new instance of the Align class that is center aligned.

Parameters:

renderable (IRenderable)
The IRenderable to align.
vertical (VerticalAlignment?)
The vertical alignment, or null if none.

Returns:

A new Align object.

public static Align Left(IRenderable renderable, VerticalAlignment? vertical = default)

Initializes a new instance of the Align class that is left aligned.

Parameters:

renderable (IRenderable)
The IRenderable to align.
vertical (VerticalAlignment?)
The vertical alignment, or null if none.

Returns:

A new Align object.

public static Align Right(IRenderable renderable, VerticalAlignment? vertical = default)

Initializes a new instance of the Align class that is right aligned.

Parameters:

renderable (IRenderable)
The IRenderable to align.
vertical (VerticalAlignment?)
The vertical alignment, or null if none.

Returns:

A new Align object.

Extension Methods

Align BottomAligned(this Align align)

Sets the Align object to be bottom aligned.

Returns:

The same instance so that multiple calls can be chained.

Align Height(this Align align, int? height)

Sets the height.

Returns:

The same instance so that multiple calls can be chained.

Align MiddleAligned(this Align align)

Sets the Align object to be middle aligned.

Returns:

The same instance so that multiple calls can be chained.

Align TopAligned(this Align align)

Sets the Align object to be top aligned.

Returns:

The same instance so that multiple calls can be chained.

Align VerticalAlignment(this Align align, VerticalAlignment? vertical)

Sets the vertical alignment.

Returns:

The same instance so that multiple calls can be chained.

Align Width(this Align align, int? width)

Sets the width.

Returns:

The same instance so that multiple calls can be chained.