ClassDragDropHelper<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:
public abstract class DragDropHelper<TBehavior, TState> where TBehavior : DragDropBehavior<TState> where TState : DragDropState, new()
Inheritance: objectDragDropHelper<TBehavior, TState>
Derived Classes:
Constructors
DragDropHelper()
Declaration
protected DragDropHelper()
Properties
DataConverter
Gets or sets the IDataObjectProvider instance that will be used in the drag-drop operations.
Declaration
public DataConverter DataConverter { get; set; }
Property Value
DragDropBehavior
Gets or sets the DragDropBehavior that will be used in the drag-drop operations.
Declaration
public TBehavior DragDropBehavior { get; set; }
Property Value
TBehavior
DragVisualProvider
Gets or sets the DragVisualProvider that will be used in the drag-drop operations.
Declaration
public IDragVisualProvider DragVisualProvider { get; set; }
Property Value
Methods
CreateDragVisualProviderState(Point, FrameworkElement, TState)
Creates and initializes a DragVisualProviderState object.
Declaration
protected virtual DragVisualProviderState CreateDragVisualProviderState(Point relativeStartPoint, FrameworkElement control, TState state)
Parameters
relativeStartPoint
Point
control
FrameworkElement
state
TState
Returns
CreateStateForDrop(FrameworkElement, FrameworkElement, object, Type)
Creates and initializes a DragDropState from the provided DragEventArgs.
DragDropCompleted(FrameworkElement, object, Type, bool)
When overridden in a derived class allows calling custom code on the DragDropCompleted event.
DragLeave(FrameworkElement, FrameworkElement, object, Type)
When overridden in a derived class allows calling custom code on the MouseLeave event.
Declaration
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
The drag and drop data.
itemType
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.
Drop(FrameworkElement, FrameworkElement, object, Type)
When overridden in a derived class allows custom code in the Drop event.
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
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
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
protected abstract FrameworkElement FindDropItemsControl(FrameworkElement element, object data)
Parameters
element
FrameworkElement
The element that raised the Drop event.
data
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
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
protected virtual DependencyObject GetContainerFromItem(FrameworkElement control, object item)
Parameters
control
FrameworkElement
item
Returns
DependencyObject
GetDraggedItems(FrameworkElement)
When overridden in a derived class this method returns the items that should be dragged.
Declaration
protected abstract IEnumerable<object> GetDraggedItems(FrameworkElement draggedItem)
Parameters
draggedItem
FrameworkElement
The source control of the drag operation.
Returns
The items that should be dragged.
GetInferredItemType(IEnumerable)
Returns the type of the items in the provided collection.
Declaration
protected static Type GetInferredItemType(IEnumerable itemsSource)
Parameters
itemsSource
Returns
GetItemType(FrameworkElement)
Returns the Type of the items in the provided control.
Declaration
protected Type GetItemType(FrameworkElement control)
Parameters
control
FrameworkElement
Returns
GetItemsFromDataObject(object, Type)
Retrieves items from the specified data object only of the specified type.
Declaration
protected IEnumerable GetItemsFromDataObject(object data, Type itemType)
Parameters
data
itemType
Returns
GetItemsOfType(IEnumerable, Type)
Returns IEnumerable containing only items from the provided Type.
Declaration
protected static IEnumerable GetItemsOfType(IEnumerable enumerable, Type itemType)
Parameters
enumerable
itemType
Returns
GetItemsSource(FrameworkElement)
Returns a list containing the items of the specified control.
Declaration
protected virtual IList GetItemsSource(FrameworkElement element)
Parameters
element
FrameworkElement
Returns