Interface IPlacementStrategy
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
Methods
BeginResize(PlacementContext, ResizeHandle)
Starts resizing an element of this container from handle.
IResizeOperation BeginResize(PlacementContext context, ResizeHandle handle)
Parameters
contextPlacementContextThe container and the element, as they were when the gesture started.
handleResizeHandleThe 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
contextPlacementContextThe container and the dragged element.
pointVector2Where 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.