Class
DragDropHelper<TBehavior, TState>

Binds the DragDropManager events with a DragDropBehavior.

Definition

Namespace:Telerik.Windows.DragDrop.Behaviors

Assembly:Telerik.Windows.Controls.dll

Type Parameters:

TBehavior

TState

Syntax:

cs-api-definition
public abstract class DragDropHelper<TBehavior, TState> where TBehavior : DragDropBehavior<TState> where TState : DragDropState, new()

Inheritance: objectDragDropHelper<TBehavior, TState>

Derived Classes: RadListBoxDragDropHelperTaskBoardColumnDragDropHelperGridViewDragDropHelperListBoxDragDropHelper

Constructors

DragDropHelper()

Declaration

cs-api-definition
protected DragDropHelper()

Properties

DataConverter

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

Declaration

cs-api-definition
public DataConverter DataConverter { get; set; }

Property Value

DataConverter

DragDropBehavior

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

Declaration

cs-api-definition
public TBehavior DragDropBehavior { get; set; }

Property Value

TBehavior

DragVisualProvider

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

Declaration

cs-api-definition
public IDragVisualProvider DragVisualProvider { get; set; }

Property Value

IDragVisualProvider

Methods

CreateDragVisualProviderState(Point, FrameworkElement, TState)

Creates and initializes a DragVisualProviderState object.

Declaration

cs-api-definition
protected virtual DragVisualProviderState CreateDragVisualProviderState(Point relativeStartPoint, FrameworkElement control, TState state)

Parameters

relativeStartPoint

Point

control

FrameworkElement

state

TState

Returns

DragVisualProviderState

CreateStateForDrop(FrameworkElement, FrameworkElement, object, Type)

Creates and initializes a DragDropState from the provided DragEventArgs.

Declaration

cs-api-definition
protected virtual TState CreateStateForDrop(FrameworkElement dropTarget, FrameworkElement dropItemsControl, object data, Type itemType)

Parameters

dropTarget

FrameworkElement

dropItemsControl

FrameworkElement

data

object

itemType

Type

Returns

TState

DragDropCompleted(FrameworkElement, object, Type, bool)

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

Declaration

cs-api-definition
protected virtual void DragDropCompleted(FrameworkElement dropItemsControl, object data, Type itemType, bool wasCanceled)

Parameters

dropItemsControl

FrameworkElement

data

object

itemType

Type

wasCanceled

bool

DragLeave(FrameworkElement, FrameworkElement, object, Type)

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

Declaration

cs-api-definition
protected virtual void DragLeave(FrameworkElement dropTarget, FrameworkElement dropItemsControl, object data, Type itemType)

Parameters

dropTarget

FrameworkElement

The object that is being dropped.

dropItemsControl

FrameworkElement

The destination ItemsControl.

data

object

The drag and drop data.

itemType

Type

The data type of the dragged item.

DragOver(FrameworkElement, FrameworkElement, object, Type)

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

Declaration

cs-api-definition
protected virtual DragDropEffects DragOver(FrameworkElement dropTarget, FrameworkElement dropItemsControl, object data, Type itemType)

Parameters

dropTarget

FrameworkElement

dropItemsControl

FrameworkElement

data

object

itemType

Type

Returns

DragDropEffects

Drop(FrameworkElement, FrameworkElement, object, Type)

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

Declaration

cs-api-definition
protected virtual void Drop(FrameworkElement dropTarget, FrameworkElement dropItemsControl, object data, Type itemType)

Parameters

dropTarget

FrameworkElement

dropItemsControl

FrameworkElement

data

object

itemType

Type

FindDragSource(FrameworkElement)

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

Declaration

cs-api-definition
protected abstract FrameworkElement FindDragSource(FrameworkElement element)

Parameters

element

FrameworkElement

The element that raised the DragInitialize event.

Returns

FrameworkElement

FindDraggedItem(FrameworkElement)

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.

Declaration

cs-api-definition
protected abstract FrameworkElement FindDraggedItem(FrameworkElement element)

Parameters

element

FrameworkElement

The element that raised the DragInitialize event.

Returns

FrameworkElement

FindDropItemsControl(FrameworkElement, object)

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

Declaration

cs-api-definition
protected abstract FrameworkElement FindDropItemsControl(FrameworkElement element, object data)

Parameters

element

FrameworkElement

The element that raised the Drop event.

data

object

The DataObject for the current drag operation.

Returns

FrameworkElement

FindDropTarget(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.

Declaration

cs-api-definition
protected abstract FrameworkElement FindDropTarget(FrameworkElement element)

Parameters

element

FrameworkElement

The element that raised the Drop event.

Returns

FrameworkElement

GetContainerFromItem(FrameworkElement, object)

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

Declaration

cs-api-definition
protected virtual DependencyObject GetContainerFromItem(FrameworkElement control, object item)

Parameters

control

FrameworkElement

item

object

Returns

DependencyObject

GetDraggedItems(FrameworkElement)

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

Declaration

cs-api-definition
protected abstract IEnumerable<object> GetDraggedItems(FrameworkElement draggedItem)

Parameters

draggedItem

FrameworkElement

The source control of the drag operation.

Returns

IEnumerable<object>

The items that should be dragged.

GetInferredItemType(IEnumerable)

Returns the type of the items in the provided collection.

Declaration

cs-api-definition
protected static Type GetInferredItemType(IEnumerable itemsSource)

Parameters

itemsSource

IEnumerable

Returns

Type

GetItemType(FrameworkElement)

Returns the Type of the items in the provided control.

Declaration

cs-api-definition
protected Type GetItemType(FrameworkElement control)

Parameters

control

FrameworkElement

Returns

Type

GetItemsFromDataObject(object, Type)

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

Declaration

cs-api-definition
protected IEnumerable GetItemsFromDataObject(object data, Type itemType)

Parameters

data

object

itemType

Type

Returns

IEnumerable

GetItemsOfType(IEnumerable, Type)

Returns IEnumerable containing only items from the provided Type.

Declaration

cs-api-definition
protected static IEnumerable GetItemsOfType(IEnumerable enumerable, Type itemType)

Parameters

enumerable

IEnumerable

itemType

Type

Returns

IEnumerable

GetItemsSource(FrameworkElement)

Returns a list containing the items of the specified control.

Declaration

cs-api-definition
protected virtual IList GetItemsSource(FrameworkElement element)

Parameters

element

FrameworkElement

Returns

IList