Table of Contents

Interface IPlacementStrategy

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

Turns moves and resizes inside one kind of container into attribute edits: an insertion index for a stack, a cell for a grid, margins for anything else.

public interface IPlacementStrategy
Extension Methods

Remarks

Register strategies for custom containers in PlacementRegistry. All coordinates are in the container's local space.

Properties

OwnedAttributes

Gets the attributes that only mean something inside this kind of container, such as Grid.Row. They're removed from an element that moves into a different container.

IReadOnlyList<string> OwnedAttributes { get; }

Property Value

IReadOnlyList<string>

Methods

BeginResize(PlacementContext, ResizeHandle)

Starts resizing an element of this container from handle.

IResizeOperation BeginResize(PlacementContext context, ResizeHandle handle)

Parameters

context PlacementContext

The container and the element, as they were when the gesture started.

handle ResizeHandle

The dragged handle.

Returns

IResizeOperation

The operation to update while the pointer moves.

GetDropTarget(PlacementContext, Vector2)

Decides where an element dropped at point lands.

PlacementTarget? GetDropTarget(PlacementContext context, Vector2 point)

Parameters

context PlacementContext

The container and the dragged element.

point Vector2

Where the dragged element's top-left corner would be, in the container's local space.

Returns

PlacementTarget

The target, or null when the container can't take the element.