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

Binds the DragDropManager events with a DragDropBehavior.

Definition

Namespace:Telerik.Windows.DragDrop.Behaviors

Assembly:Telerik.Windows.Controls.dll

Type Parameters:

TBehavior

TState

Syntax:

C#
public abstract class DragDropHelper<TBehavior, TState> where TBehavior : DragDropBehavior<TState> where TState : DragDropState, new()

Inheritance: objectDragDropHelper<TBehavior, TState>

Derived Classes: RadListBoxDragDropHelperTaskBoardColumnDragDropHelperGridViewDragDropHelperListBoxDragDropHelper

Constructors

C#
protected DragDropHelper()

Properties

Gets or sets the IDataObjectProvider instance that will be used in the drag-drop operations.

C#
public DataConverter DataConverter { get; set; }

Gets or sets the DragDropBehavior that will be used in the drag-drop operations.

C#
public TBehavior DragDropBehavior { get; set; }

Gets or sets the DragVisualProvider that will be used in the drag-drop operations.

C#
public IDragVisualProvider DragVisualProvider { get; set; }

Methods

Creates and initializes a DragVisualProviderState object.

C#
protected virtual DragVisualProviderState CreateDragVisualProviderState(Point relativeStartPoint, FrameworkElement control, TState state)
Parameters:relativeStartPointPointcontrolFrameworkElementstateTStateReturns:

DragVisualProviderState

Creates and initializes a DragDropState from the provided DragEventArgs.

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

TState

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

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

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

C#
protected virtual 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.

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

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

DragDropEffects

When overridden in a derived class allows custom code in the Drop event.

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

Finds the control that contains the provided element. In case of a ListBox drag-drop implementation, this method should return the ListBoxItem that is going to be dragged.

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

The element that raised the DragInitialize event.

Returns:

FrameworkElement

Finds the control that contains the provided element. In case of a ListBox drag-drop implementation, this method should return a ListBox.

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

The element that raised the DragInitialize event.

Returns:

FrameworkElement

Finds the target control that should accept the dragged items. In case of a ListBox drag-drop implementation, this method should return a ListBox.

C#
protected abstract 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

Finds an item from the target control that contains the provided element. In case of a ListBox drag-drop implementation, this method should return a ListBoxItem.

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

The element that raised the Drop event.

Returns:

FrameworkElement

Returns the container for the specified item. When overridden in a derived class allows usage of custom ItemContainerGenerators.

C#
protected virtual DependencyObject GetContainerFromItem(FrameworkElement control, object item)
Parameters:controlFrameworkElementitemobjectReturns:

DependencyObject

When overridden in a derived class this method returns the items that should be dragged.

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

The source control of the drag operation.

Returns:

IEnumerable<object>

The items that should be dragged.

Returns the type of the items in the provided collection.

C#
protected static Type GetInferredItemType(IEnumerable itemsSource)
Parameters:itemsSourceIEnumerableReturns:

Type

Retrieves items from the specified data object only of the specified type.

C#
protected IEnumerable GetItemsFromDataObject(object data, Type itemType)
Parameters:dataobjectitemTypeTypeReturns:

IEnumerable

Returns IEnumerable containing only items from the provided Type.

C#
protected static IEnumerable GetItemsOfType(IEnumerable enumerable, Type itemType)
Parameters:enumerableIEnumerableitemTypeTypeReturns:

IEnumerable

Returns a list containing the items of the specified control.

C#
protected virtual IList GetItemsSource(FrameworkElement element)
Parameters:elementFrameworkElementReturns:

IList

Returns the Type of the items in the provided control.

C#
protected Type GetItemType(FrameworkElement control)
Parameters:controlFrameworkElementReturns:

Type