Skip to content

DragBinding

Namespace: Hex1b.Input

Assembly: Hex1b.dll

A binding that initiates a drag operation on mouse down. The factory is called at drag start and returns a DragHandler that receives subsequent events.

csharp
public sealed class DragBinding

Inheritance

ObjectDragBinding

Constructors

DragBinding(MouseButton, Hex1bModifiers, Func<int, int, DragHandler>, string?, ActionId?)

Parameters:

csharp
public DragBinding(MouseButton button, Hex1bModifiers modifiers, Func<int, int, DragHandler> factory, string? description, ActionId? actionId = null)

Properties

ActionId

A stable identifier for the action this binding performs. Used for programmatic rebinding via .

Returns: Nullable<ActionId>

csharp
public ActionId? ActionId { get; }

Button

The mouse button that initiates the drag.

Returns: MouseButton

csharp
public MouseButton Button { get; }

Description

Human-readable description of what this drag binding does.

Returns: String

csharp
public string? Description { get; }

Factory

Factory that creates a DragHandler when the drag starts. Receives the local (x, y) coordinates where the drag began.

Returns: Func<Int32, Int32, DragHandler>

csharp
public Func<int, int, DragHandler> Factory { get; }

Modifiers

Required modifier keys.

Returns: Hex1bModifiers

csharp
public Hex1bModifiers Modifiers { get; }

Methods

Matches(Hex1bMouseEvent)

Checks if this binding matches the given mouse down event.

Parameters:

Returns: Boolean

csharp
public bool Matches(Hex1bMouseEvent mouseEvent)

StartDrag(int, int)

Starts the drag by invoking the factory with the local coordinates.

Parameters:

Returns: DragHandler

csharp
public DragHandler StartDrag(int localX, int localY)

Released under the MIT License.