DragData class Core

What is being dragged inside a control tree: the payload the source hands over, the control it came from and the group it belongs to. A source starts the drag with ControlHost.BeginDrag; the targets under the pointer (IDropTarget) are asked whether they take it.

public sealed class DragData
Namespace
ArionUI.Presentation.Controls
Package
ArionUI.Presentation · dotnet add package ArionUI.Presentation --prerelease

Constructors

DragData

public DragData(object payload, Control source);

A drag of payload out of source.

Properties

Ended

public Action<bool>? Ended { get; init; }

Told when the drag ends: true when a target took it, false when it was cancelled (Escape, released where no target takes it). Null for none.

Group

public string? Group { get; init; }

The group the drag belongs to: a target takes drags of its own group only (drop lists sharing a key). Null for none.

Payload

public object Payload { get; }

What is carried - an item, a field, whatever the source and its targets agree on.

Refusal

public string? Refusal { get; set; }

Why the target under the pointer refuses the drag ("The values area takes values only"), set by that target in IDropTarget.DragOver; the host shows it beside the pointer, under the ghost. Cleared before every move; null while nothing refuses or a target refuses without saying why.

Source

public Control Source { get; }

The control the drag started on; the host draws it under the pointer as the drag's ghost.