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

Represents drag and drop helper for the RadListBox control.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.dll

Syntax:

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

Inheritance: objectDragDropHelper<ListBoxDragDropBehavior, DragDropState>RadListBoxDragDropHelper

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

Initializes a new instance of the RadListBoxDragDropHelper class.

C#
public RadListBoxDragDropHelper()

Methods

Creates and initializes a DragDropState from the provided DragEventArgs.

C#
protected override DragDropState CreateStateForDrop(FrameworkElement dropTarget, FrameworkElement dropItemsControl, object data, Type itemType)
Parameters:dropTargetFrameworkElementdropItemsControlFrameworkElementdataobjectitemTypeTypeReturns:

DragDropState

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

When overridden in a derived class allows calling custom code on the DragDropCompleted event.

C#
protected override void DragDropCompleted(FrameworkElement dropItemsControl, object data, Type itemType, bool wasCanceled)
Parameters:dropItemsControlFrameworkElementdataobjectitemTypeTypewasCanceledbool

Overrides: DragDropHelper<ListBoxDragDropBehavior, DragDropState>.DragDropCompleted(FrameworkElement, object, Type, bool)

Hides the drop visual on mouse leave.

C#
protected override void DragLeave(FrameworkElement dropTarget, FrameworkElement dropItemsControl, object data, Type itemType)
Parameters:dropTargetFrameworkElement

The object that is being dropped.

dropItemsControlFrameworkElement

The destination ItemsControl.

dataobject

The drag and drop data.

itemTypeType

The data type of the dragged item.

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

When overridden in a derived class allows calling custom code on the DragOver event.

C#
protected override DragDropEffects DragOver(FrameworkElement dropTarget, FrameworkElement dropItemsControl, object data, Type itemType)
Parameters:dropTargetFrameworkElementdropItemsControlFrameworkElementdataobjectitemTypeTypeReturns:

DragDropEffects

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

Drops the specified drop target.

C#
protected override void Drop(FrameworkElement dropTarget, FrameworkElement dropItemsControl, object data, Type itemType)
Parameters:dropTargetFrameworkElementdropItemsControlFrameworkElementdataobjectitemTypeType

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

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)

Initialize the DragVisualPlaceholder used in the DragAndDrop operations.

C#
public void SetDropVisualPlaceholder(ContentPresenter dropVisualPlaceholder)
Parameters:dropVisualPlaceholderContentPresenter

Initialize the DropVisualProvider used in the DragAndDrop operations.

C#
public void SetDropVisualProvider(IDropVisualProvider dropVisualProvider)
Parameters:dropVisualProviderIDropVisualProvider