New to Telerik UI for WPFStart a free 30-day trial

Provides helper methods for drag-and-drop operations in ListBox controls.

Definition

Namespace:Telerik.Windows.DragDrop.Behaviors

Assembly:Telerik.Windows.Controls.dll

Syntax:

C#
public class ListBoxDragDropHelper : DragDropHelper<ListBoxDragDropBehavior, DragDropState>

Inheritance: objectDragDropHelper<ListBoxDragDropBehavior, DragDropState>ListBoxDragDropHelper

Inherited Members DragDropHelper<ListBoxDragDropBehavior, DragDropState>.GetItemsOfType(IEnumerable, Type)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.GetInferredItemType(IEnumerable)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.GetDraggedItems(FrameworkElement)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.GetItemsSource(FrameworkElement)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.GetContainerFromItem(FrameworkElement, object)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.CreateDragVisualProviderState(Point, FrameworkElement, DragDropState)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.FindDragSource(FrameworkElement)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.FindDraggedItem(FrameworkElement)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.FindDropItemsControl(FrameworkElement, object)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.FindDropTarget(FrameworkElement)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.GetItemType(FrameworkElement)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.DragDropCompleted(FrameworkElement, object, Type, bool)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.DragOver(FrameworkElement, FrameworkElement, object, Type)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.DragLeave(FrameworkElement, FrameworkElement, object, Type)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.Drop(FrameworkElement, FrameworkElement, object, Type)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.CreateStateForDrop(FrameworkElement, FrameworkElement, object, Type)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.GetItemsFromDataObject(object, Type)DragDropHelper<ListBoxDragDropBehavior, DragDropState>.DataConverterDragDropHelper<ListBoxDragDropBehavior, DragDropState>.DragDropBehaviorDragDropHelper<ListBoxDragDropBehavior, DragDropState>.DragVisualProvider...

Constructors

C#
public ListBoxDragDropHelper()

Methods

Finds the ListBoxItem that contains the provided element.

C#
protected override FrameworkElement FindDraggedItem(FrameworkElement element)
Parameters:elementFrameworkElement

The element that raised the DragInitialize event.

Returns:

FrameworkElement

Overrides: DragDropHelper<ListBoxDragDropBehavior, DragDropState>.FindDraggedItem(FrameworkElement)

Finds the ListBox that contains the provided element.

C#
protected override FrameworkElement FindDragSource(FrameworkElement element)
Parameters:elementFrameworkElement

The element that raised the DragInitialize event.

Returns:

FrameworkElement

Overrides: DragDropHelper<ListBoxDragDropBehavior, DragDropState>.FindDragSource(FrameworkElement)

Finds the ListBox that should accept the dragged items.

C#
protected override FrameworkElement FindDropItemsControl(FrameworkElement element, object data)
Parameters:elementFrameworkElement

The element that raised the Drop event.

dataobject

The DataObject for the current drag operation.

Returns:

FrameworkElement

Overrides: DragDropHelper<ListBoxDragDropBehavior, DragDropState>.FindDropItemsControl(FrameworkElement, object)

Finds a ListBoxItem from the target control that contains the provided element.

C#
protected override FrameworkElement FindDropTarget(FrameworkElement element)
Parameters:elementFrameworkElement

The element that raised the Drop event.

Returns:

FrameworkElement

Overrides: DragDropHelper<ListBoxDragDropBehavior, DragDropState>.FindDropTarget(FrameworkElement)

Returns the SelectedItems list of the ListBox that contains the dragged item and adds the dragged item to the list if it is not already present there.

C#
protected override IEnumerable<object> GetDraggedItems(FrameworkElement draggedItem)
Parameters:draggedItemFrameworkElement

The source control of the drag operation.

Returns:

IEnumerable<object>

The items that should be dragged.

Overrides: DragDropHelper<ListBoxDragDropBehavior, DragDropState>.GetDraggedItems(FrameworkElement)