Skip to content

DragDropExtensions

Namespace: Hex1b

Assembly: Hex1b.dll

Extension methods for creating and .

csharp
public static class DragDropExtensions

Inheritance

ObjectDragDropExtensions

Methods

Draggable<TParent>(WidgetContext<TParent>, object, Func<DraggableContext, Hex1bWidget[]>)

Creates a draggable wrapper with an implicit VStack for multiple children.

Parameters:

Returns: DraggableWidget

csharp
public static DraggableWidget Draggable<TParent>(this WidgetContext<TParent> ctx, object dragData, Func<DraggableContext, Hex1bWidget[]> builder) where TParent : Hex1bWidget

Draggable<TParent>(WidgetContext<TParent>, object, Func<DraggableContext, Hex1bWidget>)

Creates a draggable wrapper around a single child widget. The builder lambda receives a with to reflect the current drag state.

Parameters:

  • ctx (WidgetContext<<TParent>>): The parent widget context.
  • dragData (Object): The reference data that will be passed to the drop target.
  • builder (Func<DraggableContext, Hex1bWidget>): A builder that creates the child widget using drag state.

Returns: DraggableWidget

csharp
public static DraggableWidget Draggable<TParent>(this WidgetContext<TParent> ctx, object dragData, Func<DraggableContext, Hex1bWidget> builder) where TParent : Hex1bWidget

Droppable<TParent>(WidgetContext<TParent>, Func<DroppableContext, Hex1bWidget[]>)

Creates a droppable target with an implicit VStack for multiple children.

Parameters:

Returns: DroppableWidget

csharp
public static DroppableWidget Droppable<TParent>(this WidgetContext<TParent> ctx, Func<DroppableContext, Hex1bWidget[]> builder) where TParent : Hex1bWidget

Droppable<TParent>(WidgetContext<TParent>, Func<DroppableContext, Hex1bWidget>)

Creates a droppable target that can receive dragged items. The builder lambda receives a with and to reflect the current drag-hover state.

Parameters:

Returns: DroppableWidget

csharp
public static DroppableWidget Droppable<TParent>(this WidgetContext<TParent> ctx, Func<DroppableContext, Hex1bWidget> builder) where TParent : Hex1bWidget

Released under the MIT License.