Class
DragDropBehavior<TState>

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:

cs-api-definition
public abstract class DragDropBehavior<TState> : DependencyObject, IDragDropBehavior<TState> where TState : DragDropState

Inheritance: objectDragDropBehavior<TState>

Derived Classes: FileBrowserDragDropBehavior

Implements: IDragDropBehavior<TState>

Constructors

DragDropBehavior()

Declaration

cs-api-definition
protected DragDropBehavior()

Methods

CanDrop(TState)

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

Declaration

cs-api-definition
public virtual bool CanDrop(TState state)

Parameters

state

TState

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.

CanStartDrag(TState)

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

Declaration

cs-api-definition
public virtual bool CanStartDrag(TState state)

Parameters

state

TState

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.

CoerceDraggedItems(TState)

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

Declaration

cs-api-definition
public IEnumerable CoerceDraggedItems(TState state)

Parameters

state

TState

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.

DragDropCanceled(TState)

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.

Declaration

cs-api-definition
public virtual void DragDropCanceled(TState state)

Parameters

state

TState

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.

DragDropCompleted(TState)

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

Declaration

cs-api-definition
public void DragDropCompleted(TState state)

Parameters

state

TState

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.

Drop(TState)

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

Declaration

cs-api-definition
public virtual void Drop(TState state)

Parameters

state

TState

DragDropState that provides context for the current operation.

Implements IDragDropBehavior<TState>.Drop(TState)

GetDragDropEffects(TState)

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

Declaration

cs-api-definition
public virtual DragDropEffects GetDragDropEffects(TState state)

Parameters

state

TState

DragDropState that provides context for the current operation.

Returns

DragDropEffects

Remarks

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