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 .
public sealed class DraggableNode : Hex1bNodeInheritance
Object → Hex1bNode → DraggableNode
Properties
Child
The single child node.
Returns: Hex1bNode
public Hex1bNode? Child { get; set; }DragData
The reference data that will be passed to the drop target.
Returns: Object
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
public override Rect HitTestBounds { get; }IsDragging
Whether this node is currently being dragged. Set by .
Returns: Boolean
public bool IsDragging { get; set; }IsFocusable
Returns true if this node can receive focus.
Returns: Boolean
public override bool IsFocusable { get; }IsHovered
Whether the mouse is currently hovering over this node.
Returns: Boolean
public override bool IsHovered { get; set; }SourceWidget
The source widget that was reconciled into this node.
Returns: DraggableWidget
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:
rect(Rect):
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:
bindings(InputBindingsBuilder): The builder to add bindings to.
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>
public override IReadOnlyList<Hex1bNode> GetChildren()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)