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

Defines the basic methods of a generic FileDialogs DragDropBehavior.

Definition

Namespace:Telerik.Windows.Controls.FileDialogs.DragDrop

Assembly:Telerik.Windows.Controls.FileDialogs.dll

Type Parameters:

TState

The state type.

Syntax:

C#
public abstract class DragDropBehavior<TState> : DependencyObject, IDragDropBehavior<TState> where TState : DragDropState

Inheritance: objectDragDropBehavior<TState>

Derived Classes: FileBrowserDragDropBehavior

Implements: IDragDropBehavior<TState>

Constructors

C#
protected DragDropBehavior()

Methods

Returns a value specifying whether the current drag operation can be completed.

C#
public virtual bool CanDrop(TState state)
Parameters:stateTState

DragDropState that provides context for the current operation.

Returns:

bool

True if the drag operation can be completed, otherwise false.

Implements: IDragDropBehavior<TState>.CanDrop(TState)

Remarks:

This method is called only in the context of the drop target control.

Returns a value specifying whether the drag operation can be started.

C#
public virtual bool CanStartDrag(TState state)
Parameters:stateTState

DragDropState that provides context for the current operation.

Returns:

bool

True if the drag operation can be completed, otherwise false.

Implements: IDragDropBehavior<TState>.CanStartDrag(TState)

Remarks:

This method is called only in the context of the drag source control.

When overridden in a derived class, filters the dragged items collection if necessary.

C#
public IEnumerable CoerceDraggedItems(TState state)
Parameters:stateTState

DragDropState that provides context for the current operation.

Returns:

IEnumerable

The filtered dragged items.

Implements: IDragDropBehavior<TState>.CoerceDraggedItems(TState)

Remarks:

This method is called immediately before the drag operation starts. Only the Items property of the DragDropState is valid.

When overridden in a derived class cleans up a cancelled drag operation. This method is called only in the context of the drag source control.

C#
public virtual void DragDropCanceled(TState state)
Parameters:stateTState

DragDropState that provides context for the current operation.

Implements: IDragDropBehavior<TState>.DragDropCanceled(TState)

Remarks:

This method is called only when the drag operation is cancelled by the user. If this method is called, the source's DragDropCompleted and target's Drop methods are not called.

When overridden in a derived class completes the drag operation. This method is called only in the context of the drag source control.

C#
public void DragDropCompleted(TState state)
Parameters:stateTState

DragDropState that provides context for the current operation.

Implements: IDragDropBehavior<TState>.DragDropCompleted(TState)

Remarks:

When the drag source and the drop target are the same control, this method is called after Drop. This method is called only when the drag operation completed successfully. If this method is called, DragDropCanceled is not called.

Completes the drop operation. This method is called only in the context of the drop target control.

C#
public virtual void Drop(TState state)
Parameters:stateTState

DragDropState that provides context for the current operation.

Implements: IDragDropBehavior<TState>.Drop(TState)

Returns the DragDropEffects for the current drag drop operation. The return value affects the mouse cursor.

C#
public virtual DragDropEffects GetDragDropEffects(TState state)
Parameters:stateTState

DragDropState that provides context for the current operation.

Returns:

DragDropEffects

Remarks:

This method is called only in the context of the drop target control.