Version

DragCancel Event

Occurs when drag-and-drop operation is canceled when DragDropCancelEventArgs.Cancel is set to true in some of event handlers for DragStart or DragEnter events or when DragDropManager.EndDrag method is called with dragCancel set to true.
Syntax
'Declaration
 
Public Event DragCancel As EventHandler(Of DragDropEventArgs)
public event EventHandler<DragDropEventArgs> DragCancel
Event Data

The event handler receives an argument of type DragDropEventArgs containing data related to this event. The following DragDropEventArgs properties provide information specific to this event.

PropertyDescription
CopyCursorTemplate Gets or sets the data template that will be used as cursor when coping operation is performed during dragging.
CustomMouseHolder Gets or sets the System.Windows.UIElement suggested by consumer of the event as the element which has to capture the mouse during the drag-drop.
Data Gets or sets the instance of the object that represents the dragged data.
DragSource Gets the UIElement that initiates drag operation.
DragTemplate Gets or sets the data template that will be applied to dragged element representation.
DropNotAllowedCursorTemplate Gets or sets the data template that will be used as cursor when drag operation is performed but drop dragged item is not over appropriate target.
DropTarget Gets the instance of the object marked as drop target.
MoveCursorTemplate Gets or sets the data template that will be used as cursor when item is draged over appropriate drop target.
OperationType Gets or sets the type of intended action during drag-and-drop operation. Setting this property will enforce the applying of related cursor.
OriginalDragSource Gets the original reporting source as determined by pure hit testing.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also