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
protected DragDropHelper()
Properties
Gets or sets the IDataObjectProvider instance that will be used in the drag-drop operations.
public DataConverter DataConverter { get; set; }
DragDropBehavior
TBehavior
Gets or sets the DragDropBehavior that will be used in the drag-drop operations.
public TBehavior DragDropBehavior { get; set; }
Gets or sets the DragVisualProvider that will be used in the drag-drop operations.
public IDragVisualProvider DragVisualProvider { get; set; }
Methods
Creates and initializes a DragVisualProviderState object.
protected virtual DragVisualProviderState CreateDragVisualProviderState(Point relativeStartPoint, FrameworkElement control, TState state)
Creates and initializes a DragDropState from the provided DragEventArgs.
When overridden in a derived class allows calling custom code on the MouseLeave event.
protected virtual void DragLeave(FrameworkElement dropTarget, FrameworkElement dropItemsControl, object data, Type itemType)
The object that is being dropped.
dropItemsControlFrameworkElementThe destination ItemsControl.
dataobjectThe drag and drop data.
itemTypeTypeThe data type of the dragged item.
DragOver(FrameworkElement, FrameworkElement, object, Type)
DragDropEffects
When overridden in a derived class allows calling custom code on the DragOver event.
FindDraggedItem(FrameworkElement)
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.
protected abstract FrameworkElement FindDraggedItem(FrameworkElement element)
The element that raised the DragInitialize event.
Returns:FrameworkElement
FindDragSource(FrameworkElement)
FrameworkElement
Finds the control that contains the provided element. In case of a ListBox drag-drop implementation, this method should return a ListBox.
protected abstract FrameworkElement FindDragSource(FrameworkElement element)
The element that raised the DragInitialize event.
Returns:FrameworkElement
FindDropItemsControl(FrameworkElement, object)
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.
protected abstract FrameworkElement FindDropItemsControl(FrameworkElement element, object data)
The element that raised the Drop event.
dataobjectThe DataObject for the current drag operation.
Returns:FrameworkElement
FindDropTarget(FrameworkElement)
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.
protected abstract FrameworkElement FindDropTarget(FrameworkElement element)
The element that raised the Drop event.
Returns:FrameworkElement
GetContainerFromItem(FrameworkElement, object)
DependencyObject
Returns the container for the specified item. When overridden in a derived class allows usage of custom ItemContainerGenerators.
protected virtual DependencyObject GetContainerFromItem(FrameworkElement control, object item)
DependencyObject
When overridden in a derived class this method returns the items that should be dragged.
protected abstract IEnumerable<object> GetDraggedItems(FrameworkElement draggedItem)
The source control of the drag operation.
Returns:The items that should be dragged.
Returns the type of the items in the provided collection.
protected static Type GetInferredItemType(IEnumerable itemsSource)
Returns IEnumerable containing only items from the provided Type.
protected static IEnumerable GetItemsOfType(IEnumerable enumerable, Type itemType)
Returns a list containing the items of the specified control.
protected virtual IList GetItemsSource(FrameworkElement element)
Returns the Type of the items in the provided control.
protected Type GetItemType(FrameworkElement control)