Method DndContext
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
DndContext(Action<DragStartArgs>?, Action<DragOverArgs>?, Action<DragEndArgs>?, Action<DragCancelArgs>?, DndCollisionDetection?, DragActivation?, string?, string?, string?, FiberElementProps?, StyleOverrides?, Func<VisualElement, Action>?, VNode?[]?, string?, string?, string?, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?)
Drag-and-drop scope. A real container element (the FocusScope precedent: the element is the stable scope identity and cleanup anchor). Draggables and droppables pair with their nearest ancestor scope at event time; one drag may be active per mounted tree at a time. Any existing container can be a scope via props (DndContext) — this factory is convenience.
public static ElementNode DndContext(Action<DragStartArgs>? onDragStart = null, Action<DragOverArgs>? onDragOver = null, Action<DragEndArgs>? onDragEnd = null, Action<DragCancelArgs>? onDragCancel = null, DndCollisionDetection? collisionDetection = null, DragActivation? activation = null, string? className = null, string? key = null, string? name = null, FiberElementProps? props = null, StyleOverrides? styles = null, Func<VisualElement, Action>? refCallback = null, VNode?[]? children = null, string? whileHoverClass = null, string? whileTapClass = null, string? whileFocusClass = null, IReadOnlyDictionary<string, string>? data = null, IReadOnlyDictionary<string, string>? aria = null)
Parameters
onDragStartAction<DragStartArgs>Fired once when a press crosses its activation constraint.
onDragOverAction<DragOverArgs>Fired when the winning drop target CHANGES (including to null).
onDragEndAction<DragEndArgs>Fired on release; state written here flushes synchronously like any discrete input handler. Over is null when dropped on nothing.
onDragCancelAction<DragCancelArgs>Fired when a drag aborts (Escape, pointer cancel, lost capture, or the source/scope unmounting mid-drag).
collisionDetectionDndCollisionDetectionCollision strategy; null means RectIntersection.
activationDragActivationScope-wide activation default; a per-draggable override wins.
classNamestringkeystringnamestringpropsFiberElementPropsstylesStyleOverridesrefCallbackFunc<VisualElement, Action>childrenVNode[]whileHoverClassstringwhileTapClassstringwhileFocusClassstringdataIReadOnlyDictionary<string, string>ariaIReadOnlyDictionary<string, string>
Returns
- ElementNode
The created ElementNode.