Skip to content

DraggableNode ​

Namespace: Hex1b.Nodes

Assembly: Hex1b.dll

A node that makes its child tree draggable. Registers a drag binding for left mouse button. When dragged, manages the drag-drop operation via .

csharp
public sealed class DraggableNode : Hex1bNode

Inheritance ​

Object → Hex1bNode → DraggableNode

Properties ​

Child ​

The single child node.

Returns: Hex1bNode

csharp
public Hex1bNode? Child { get; set; }

DragData ​

The reference data that will be passed to the drop target.

Returns: Object

csharp
public object DragData { get; set; }

HitTestBounds ​

Gets the bounds used for mouse hit testing. By default, returns the full Bounds. Override in nodes where only a portion of the bounds should respond to clicks (e.g., SplitterNode's divider).

Returns: Rect

csharp
public override Rect HitTestBounds { get; }

IsDragging ​

Whether this node is currently being dragged. Set by .

Returns: Boolean

csharp
public bool IsDragging { get; set; }

IsFocusable ​

Returns true if this node can receive focus.

Returns: Boolean

csharp
public override bool IsFocusable { get; }

IsHovered ​

Whether the mouse is currently hovering over this node.

Returns: Boolean

csharp
public override bool IsHovered { get; set; }

SourceWidget ​

The source widget that was reconciled into this node.

Returns: DraggableWidget

csharp
public DraggableWidget? 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)

ConfigureDefaultBindings(InputBindingsBuilder) ​

Configures the default input bindings for this node type. Override in derived classes to add default key bindings. These bindings can be inspected and modified by the user's callback.

Parameters:

csharp
public override void ConfigureDefaultBindings(InputBindingsBuilder bindings)

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()

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.