Skip to main content

Align Method

Aligns a rect in a constraining rect according to horizontal and vertical alignment settings.

Definition

Namespace: Avalonia.Layout
Assembly: Avalonia.Base (in Avalonia.Base.dll)

public static Rect Align(
this Rect rect,
Rect constraint,
HorizontalAlignment horizontalAlignment,
VerticalAlignment verticalAlignment
)

Parameters

  Rect
The rect to align.
  Rect
The constraining rect.
  HorizontalAlignment
The horizontal alignment.
  VerticalAlignment
The vertical alignment.

Return Value

Rect

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Rect. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

Reference

LayoutExtensions Class
Avalonia.Layout Namespace