Skip to content

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 .

csharp
public sealed class DroppableNode : Hex1bNode

Inheritance ​

Object → Hex1bNode → DroppableNode

Properties ​

AcceptPredicate ​

Predicate that determines whether this target accepts drag data. Null means accept all.

Returns: Func<Object, Boolean>

csharp
public Func<object, bool>? AcceptPredicate { get; set; }

CanAcceptDrag ​

Whether the currently hovering drag data passes the Accept predicate.

Returns: Boolean

csharp
public bool CanAcceptDrag { get; set; }

Child ​

The single child node.

Returns: Hex1bNode

csharp
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>

csharp
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>

csharp
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

csharp
public object? HoveredDragData { get; set; }

IsFocusable ​

Returns true if this node can receive focus.

Returns: Boolean

csharp
public override bool IsFocusable { get; }

IsHoveredByDrag ​

Whether a dragged item is currently hovering over this drop target. Set by .

Returns: Boolean

csharp
public bool IsHoveredByDrag { get; set; }

SourceWidget ​

The source widget that was reconciled into this node.

Returns: DroppableWidget

csharp
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:

csharp
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>

csharp
public override IReadOnlyList<Hex1bNode> GetChildren()

GetFocusableNodes() ​

Gets all focusable nodes in this subtree (including this node if focusable).

Returns: IEnumerable<Hex1bNode>

csharp
public override IEnumerable<Hex1bNode> GetFocusableNodes()

MeasureCore(Constraints) ​

Override this method to implement measuring logic for this node.

Parameters:

Returns: Size

csharp
protected override Size MeasureCore(Constraints constraints)

Render(Hex1bRenderContext) ​

Renders the node to the given context.

Parameters:

csharp
public override void Render(Hex1bRenderContext context)

Released under the MIT License.