Table of Contents

Class PlacementRegistry

Namespace
Icy.Design.Editor.Placement
Assembly
IcyUI.Design.dll

Chooses the placement strategy for a container: the registration for the most derived of its types, or MarginPlacement when none matches.

public sealed class PlacementRegistry
Inheritance
PlacementRegistry
Inherited Members
Extension Methods

Constructors

PlacementRegistry()

Initializes a new instance of the PlacementRegistry class with the built-in strategies: StackPanelPlacement for StackPanel and GridPlacement for Grid.

public PlacementRegistry()

Methods

Register(Type, IPlacementStrategy)

Registers the strategy for containerType and the containers derived from it, replacing any earlier registration for that type.

public void Register(Type containerType, IPlacementStrategy strategy)

Parameters

containerType Type

The container type; a UIElement.

strategy IPlacementStrategy

The strategy.

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

containerType isn't a UIElement.

Register<TContainer>(IPlacementStrategy)

Registers the strategy for TContainer and the containers derived from it, replacing any earlier registration for that type.

public void Register<TContainer>(IPlacementStrategy strategy) where TContainer : UIElement

Parameters

strategy IPlacementStrategy

The strategy.

Type Parameters

TContainer

The container type.

Resolve(UIElement)

Gets the strategy for container.

public IPlacementStrategy Resolve(UIElement container)

Parameters

container UIElement

The container.

Returns

IPlacementStrategy

The registered strategy for its most derived registered type, or the margin fallback.