DroppableNode
Namespace: Hex1b.Nodes
Assembly: Hex1b.dll
A node that acts as a drop target for drag-and-drop operations. Not focusable itself — children can be focusable (including ). Drop target state (hover, acceptance) is managed by via .
public sealed class DroppableNode : Hex1bNodeInheritance
Object → Hex1bNode → DroppableNode
Properties
AcceptPredicate
Predicate that determines whether this target accepts drag data. Null means accept all.
Returns: Func<Object, Boolean>
public Func<object, bool>? AcceptPredicate { get; set; }CanAcceptDrag
Whether the currently hovering drag data passes the Accept predicate.
Returns: Boolean
public bool CanAcceptDrag { get; set; }Child
The single child node.
Returns: Hex1bNode
public Hex1bNode? Child { get; set; }DropAction
The async action to execute when a valid item is dropped on this target. Parameters: context, dragData, sourceNode, localX, localY.
Returns: Func<InputBindingActionContext, Object, DraggableNode, Int32, Int32, Task>
public Func<InputBindingActionContext, object, DraggableNode, int, int, Task>? DropAction { get; set; }DropTargetAction
The async action to execute when a valid item is dropped on a specific . Parameters: context, targetId, dragData, sourceNode.
Returns: Func<InputBindingActionContext, String, Object, DraggableNode, Task>
public Func<InputBindingActionContext, string, object, DraggableNode, Task>? DropTargetAction { get; set; }HoveredDragData
The drag data of the item currently hovering. Null if not hovered.
Returns: Object
public object? HoveredDragData { get; set; }IsFocusable
Returns true if this node can receive focus.
Returns: Boolean
public override bool IsFocusable { get; }IsHoveredByDrag
Whether a dragged item is currently hovering over this drop target. Set by .
Returns: Boolean
public bool IsHoveredByDrag { get; set; }SourceWidget
The source widget that was reconciled into this node.
Returns: DroppableWidget
public DroppableWidget? SourceWidget { get; set; }Methods
ArrangeCore(Rect)
Override this method to implement arranging logic for this node. The base implementation saves previous bounds, marks dirty on change, and sets bounds.
Parameters:
rect(Rect):
protected override void ArrangeCore(Rect rect)GetChildren()
Gets the direct children of this node for structural tree traversal. Container nodes should override this to return their children.
Returns: IReadOnlyList<Hex1bNode>
public override IReadOnlyList<Hex1bNode> GetChildren()GetFocusableNodes()
Gets all focusable nodes in this subtree (including this node if focusable).
Returns: IEnumerable<Hex1bNode>
public override IEnumerable<Hex1bNode> GetFocusableNodes()MeasureCore(Constraints)
Override this method to implement measuring logic for this node.
Parameters:
constraints(Constraints):
Returns: Size
protected override Size MeasureCore(Constraints constraints)Render(Hex1bRenderContext)
Renders the node to the given context.
Parameters:
context(Hex1bRenderContext):
public override void Render(Hex1bRenderContext context)