Table of Contents

Class LayoutManager

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Provides layout management functionality for arranging and sizing controls and items within a container. Supports various layout styles and alignment options.

public class LayoutManager : BaseObject, IBaseObject, ILayoutManager
Inheritance
LayoutManager
Implements
Extension Methods

Remarks

The LayoutManager class offers default implementations for control layout and preferred size calculations, which are invoked by container controls during layout operations. It supports multiple layout styles, including dock, stack, and scroll, and provides alignment utilities for both horizontal and vertical positioning. This class is intended for use by control authors and advanced users who need to customize or extend layout behavior.

Properties

Instance

Gets or sets the default instance of the ILayoutManager to be used by controls and containers that do not specify a custom layout manager.

Methods

AlignHorizontal(RectD, ILayoutItem, SizeD, HorizontalAlignment)

Calculates horizontal position using align parameters.

AlignVertical(RectD, ILayoutItem, SizeD, VerticalAlignment)

Calculates vertical position using align parameters.

ChildIgnoresLayout(ILayoutItem)

Determines whether the specified child layout item should be excluded from layout calculations.

GetPreferredSizeWhenStack(ILayoutItem, PreferredSizeContext, bool, IReadOnlyList<ILayoutItem>?, bool)

Calculates the preferred size for a container when arranging its child layout items in a stack, either vertically or horizontally.

LayoutWhenDocked(ref RectD, ILayoutItem, DockStyle, LayoutFlags)

Arranges the specified child layout item within the given bounds according to the provided dock style, updating the bounds to reflect the remaining available space.

OnGetPreferredSize(ILayoutItem, PreferredSizeContext, LayoutStyle)

Retrieves the size of a rectangular area into which a control or item can be fitted, in device-independent units. This method checks the layout style and calls the appropriate method to calculate the preferred size.

OnLayout(ILayoutItem, LayoutStyle, Func<RectD>, IReadOnlyList<ILayoutItem>)

Called when the control or item should reposition its child controls. This method checks the layout style and calls the appropriate method to perform the layout of child controls.