Class
DragDropManager

Provides helper methods and fields for initiating drag-and-drop operations, including a method to begin a drag-and-drop operation, and facilities for adding and removing drag-and-drop related event handlers.

Definition

Namespace:Telerik.Windows.DragDrop

Assembly:Telerik.Windows.Controls.dll

Syntax:

cs-api-definition
public static class DragDropManager

Inheritance: objectDragDropManager

Fields

AllowCapturedDragProperty

Identifies the AllowCapturedDrag attached dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty AllowCapturedDragProperty

Field Value

DependencyProperty

AllowDragProperty

Identifies the AllowDrag attached dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty AllowDragProperty

Field Value

DependencyProperty

Properties

DefaultDragDropEffects

Gets or sets the AllowedEffect for a drag-and-drop operation if such are not specified in DragInitialize event arguments.

Declaration

cs-api-definition
public static DragDropEffects DefaultDragDropEffects { get; set; }

Property Value

DragDropEffects

IsDragInProgress

Gets a value indicating whether a drag is in progress.

Declaration

cs-api-definition
public static bool IsDragInProgress { get; }

Property Value

bool

IsFullTrust

Gets whether application have FullTrust permissions.

Declaration

cs-api-definition
public static bool IsFullTrust { get; }

Property Value

bool

MinimumHorizontalDragDistance

Gets or sets the width of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins. The default value is 4.0.

Declaration

cs-api-definition
public static double MinimumHorizontalDragDistance { get; set; }

Property Value

double

MinimumVerticalDragDistance

Gets or sets the height of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins.

Declaration

cs-api-definition
public static double MinimumVerticalDragDistance { get; set; }

Property Value

double

UseAdornerLayer

Gets or sets a value that indicates whether drag visual will be displayed in the adorner layer or in separate window.

Declaration

cs-api-definition
public static bool UseAdornerLayer { get; set; }

Property Value

bool

Methods

AddDragDropCompletedHandler(DependencyObject, DragDropCompletedEventHandler)

Adds a DragDropCompleted event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddDragDropCompletedHandler(DependencyObject element, DragDropCompletedEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragDropCompletedEventHandler

A delegate that references the handler method to be added.

Remarks

The DragDropCompleted event occurs when an drag-and-drop operation ends(On Drop or Cancel).

AddDragDropCompletedHandler(DependencyObject, DragDropCompletedEventHandler, bool)

Adds a DragDropCompleted event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddDragDropCompletedHandler(DependencyObject element, DragDropCompletedEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragDropCompletedEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The DragDropCompleted event occurs when an drag-and-drop operation ends(On Drop or Cancel).

AddDragEnterHandler(DependencyObject, DragEventHandler)

Adds a DragEnter event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddDragEnterHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

Remarks

The DragEnter event occurs when an object is dragged into the element's bounds. This method adds a handler for the bubbling version of the DragEnter event. To add a handler for the tunneling version of this event, see AddPreviewDragEnterHandler.

AddDragEnterHandler(DependencyObject, DragEventHandler, bool)

Adds a DragEnter event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddDragEnterHandler(DependencyObject element, DragEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The DragEnter event occurs when an object is dragged into the element's bounds. This method adds a handler for the bubbling version of the DragEnter event. To add a handler for the tunneling version of this event, see AddPreviewDragEnterHandler.

AddDragInitializeHandler(DependencyObject, DragInitializeEventHandler)

Adds a DragInitialize event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddDragInitializeHandler(DependencyObject element, DragInitializeEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragInitializeEventHandler

A delegate that references the handler method to be added.

Remarks

The DragInitialize event occurs when an object is about to be dragged. All needed information about the drag should be passed to the event arguments. Drag start can be stopped by setting Cancel=true.

AddDragInitializeHandler(DependencyObject, DragInitializeEventHandler, bool)

Adds a DragInitialize event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddDragInitializeHandler(DependencyObject element, DragInitializeEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragInitializeEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The DragInitialize event occurs when an object is about to be dragged. All needed information about the drag should be passed to the event arguments. Drag start can be stopped by setting Cancel=true.

AddDragLeaveHandler(DependencyObject, DragEventHandler)

Adds a DragLeave event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddDragLeaveHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

Remarks

The DragLeave event occurs when an object is dragged out of the element's bounds. This method adds a handler for the bubbling version of the DragLeave event. To add a handler for the tunneling version of this event, see AddPreviewDragLeaveHandler.

AddDragLeaveHandler(DependencyObject, DragEventHandler, bool)

Adds a DragLeave event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddDragLeaveHandler(DependencyObject element, DragEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The DragLeave event occurs when an object is dragged out of the element's bounds. This method adds a handler for the bubbling version of the DragLeave event. To add a handler for the tunneling version of this event, see AddPreviewDragLeaveHandler.

AddDragOverHandler(DependencyObject, DragEventHandler)

Adds a DragOver event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddDragOverHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

Remarks

The DragOver event occurs when an object is dragged over the element's bounds. This method adds a handler for the bubbling version of the DragOver event. To add a handler for the tunneling version of this event, see AddPreviewDragOverHandler.

AddDragOverHandler(DependencyObject, DragEventHandler, bool)

Adds a DragOver event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddDragOverHandler(DependencyObject element, DragEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The DragOver event occurs when an object is dragged over the element's bounds. This method adds a handler for the bubbling version of the DragOver event. To add a handler for the tunneling version of this event, see AddPreviewDragOverHandler.

AddDropHandler(DependencyObject, DragEventHandler)

Adds a Drop event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddDropHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

Remarks

The Drop event occurs when an object is dropped within an element's bounds. This method adds a handler for the bubbling version of the Drop event. To add a handler for the tunneling version of this event, see AddPreviewDropHandler.

AddDropHandler(DependencyObject, DragEventHandler, bool)

Adds a Drop event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddDropHandler(DependencyObject element, DragEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The Drop event occurs when an object is dropped within an element's bounds. This method adds a handler for the bubbling version of the Drop event. To add a handler for the tunneling version of this event, see AddPreviewDropHandler.

AddGiveFeedbackHandler(DependencyObject, GiveFeedbackEventHandler)

Adds a GiveFeedback event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddGiveFeedbackHandler(DependencyObject element, GiveFeedbackEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

GiveFeedbackEventHandler

A delegate that references the handler method to be added.

Remarks

The GiveFeedback event occurs during a drag operation. This method adds a handler for the bubbling version of the GiveFeedback event. To add a handler for the tunneling version of this event, see AddPreviewGiveFeedbackHandler.

AddGiveFeedbackHandler(DependencyObject, GiveFeedbackEventHandler, bool)

Adds a GiveFeedback event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddGiveFeedbackHandler(DependencyObject element, GiveFeedbackEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

GiveFeedbackEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The GiveFeedback event occurs during a drag operation. This method adds a handler for the bubbling version of the GiveFeedback event. To add a handler for the tunneling version of this event, see AddPreviewGiveFeedbackHandler.

AddPreviewDragEnterHandler(DependencyObject, DragEventHandler)

Adds a PreviewDragEnter event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddPreviewDragEnterHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

Remarks

The PreviewDragEnter event occurs when an object is dragged into the element's bounds. This method adds a handler for the tunneling version of the PreviewDragEnter event. To add a handler for the bubbling version of this event, see AddDragEnterHandler.

AddPreviewDragEnterHandler(DependencyObject, DragEventHandler, bool)

Adds a PreviewDragEnter event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddPreviewDragEnterHandler(DependencyObject element, DragEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The PreviewDragEnter event occurs when an object is dragged into the element's bounds. This method adds a handler for the tunneling version of the PreviewDragEnter event. To add a handler for the bubbling version of this event, see AddDragEnterHandler.

AddPreviewDragLeaveHandler(DependencyObject, DragEventHandler)

Adds a PreviewDragLeave event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddPreviewDragLeaveHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

Remarks

The PreviewDragLeave event occurs when an object is dragged out of the element's bounds. This method adds a handler for the tunneling version of the PreviewDragLeave event. To add a handler for the bubbling version of this event, see AddDragLeaveHandler.

AddPreviewDragLeaveHandler(DependencyObject, DragEventHandler, bool)

Adds a PreviewDragLeave event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddPreviewDragLeaveHandler(DependencyObject element, DragEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The PreviewDragLeave event occurs when an object is dragged out of the element's bounds. This method adds a handler for the tunneling version of the PreviewDragLeave event. To add a handler for the bubbling version of this event, see AddDragLeaveHandler.

AddPreviewDragOverHandler(DependencyObject, DragEventHandler)

Adds a PreviewDragOver event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddPreviewDragOverHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

Remarks

The PreviewDragOver event occurs when an object is dragged over the element's bounds. This method adds a handler for the tunneling version of the PreviewDragOver event. To add a handler for the bubbling version of this event, see AddDragOverHandler.

AddPreviewDragOverHandler(DependencyObject, DragEventHandler, bool)

Adds a PreviewDragOver event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddPreviewDragOverHandler(DependencyObject element, DragEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The PreviewDragOver event occurs when an object is dragged over the element's bounds. This method adds a handler for the tunneling version of the PreviewDragOver event. To add a handler for the bubbling version of this event, see AddDragOverHandler.

AddPreviewDropHandler(DependencyObject, DragEventHandler)

Adds a PreviewDrop event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddPreviewDropHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

Remarks

The PreviewDrop event occurs when an object is dropped within an element's bounds. This method adds a handler for the tunneling version of the PreviewDrop event. To add a handler for the bubbling version of this event, see AddDropHandler.

AddPreviewDropHandler(DependencyObject, DragEventHandler, bool)

Adds a PreviewDrop event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddPreviewDropHandler(DependencyObject element, DragEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

DragEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The PreviewDrop event occurs when an object is dropped within an element's bounds. This method adds a handler for the tunneling version of the PreviewDrop event. To add a handler for the bubbling version of this event, see AddDropHandler.

AddPreviewGiveFeedbackHandler(DependencyObject, GiveFeedbackEventHandler)

Adds a PreviewGiveFeedback event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddPreviewGiveFeedbackHandler(DependencyObject element, GiveFeedbackEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

GiveFeedbackEventHandler

A delegate that references the handler method to be added.

Remarks

The PreviewGiveFeedback event occurs during a drag operation. This method adds a handler for the tunneling version of the PreviewGiveFeedback event. To add a handler for the bubbling version of this event, see AddGiveFeedbackHandler.

AddPreviewGiveFeedbackHandler(DependencyObject, GiveFeedbackEventHandler, bool)

Adds a PreviewGiveFeedback event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddPreviewGiveFeedbackHandler(DependencyObject element, GiveFeedbackEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

GiveFeedbackEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The PreviewGiveFeedback event occurs during a drag operation. This method adds a handler for the tunneling version of the PreviewGiveFeedback event. To add a handler for the bubbling version of this event, see AddGiveFeedbackHandler.

AddPreviewQueryContinueDragHandler(DependencyObject, QueryContinueDragEventHandler)

Adds a PreviewQueryContinueDrag event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddPreviewQueryContinueDragHandler(DependencyObject element, QueryContinueDragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

QueryContinueDragEventHandler

A delegate that references the handler method to be added.

Remarks

The PreviewQueryContinueDrag event occurs during a drag-and-drop operation, and enables the drag source to determine whether the drag-and-drop operation should be canceled. This method adds a handler for the tunneling version of the PreviewQueryContinueDrag event. To add a handler for the bubbling version of this event, see AddQueryContinueDragHandler.

AddPreviewQueryContinueDragHandler(DependencyObject, QueryContinueDragEventHandler, bool)

Adds a PreviewQueryContinueDrag event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddPreviewQueryContinueDragHandler(DependencyObject element, QueryContinueDragEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

QueryContinueDragEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The PreviewQueryContinueDrag event occurs during a drag-and-drop operation, and enables the drag source to determine whether the drag-and-drop operation should be canceled. This method adds a handler for the tunneling version of the PreviewQueryContinueDrag event. To add a handler for the bubbling version of this event, see AddQueryContinueDragHandler.

AddQueryContinueDragHandler(DependencyObject, QueryContinueDragEventHandler)

Adds a QueryContinueDrag event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddQueryContinueDragHandler(DependencyObject element, QueryContinueDragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

QueryContinueDragEventHandler

A delegate that references the handler method to be added.

Remarks

The QueryContinueDrag event occurs during a drag-and-drop operation, and enables the drag source to determine whether the drag-and-drop operation should be canceled. This method adds a handler for the tunneling version of the QueryContinueDrag event. To add a handler for the bubbling version of this event, see AddPreviewQueryContinueDragHandler.

AddQueryContinueDragHandler(DependencyObject, QueryContinueDragEventHandler, bool)

Adds a QueryContinueDrag event handler to a specified dependency object.

Declaration

cs-api-definition
public static void AddQueryContinueDragHandler(DependencyObject element, QueryContinueDragEventHandler handler, bool handledEventsToo)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler

QueryContinueDragEventHandler

A delegate that references the handler method to be added.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled. The default is false.

Remarks

The QueryContinueDrag event occurs during a drag-and-drop operation, and enables the drag source to determine whether the drag-and-drop operation should be canceled. This method adds a handler for the tunneling version of the QueryContinueDrag event. To add a handler for the bubbling version of this event, see AddPreviewQueryContinueDragHandler.

DoDragDrop(DependencyObject, object, DragDropEffects, DragDropKeyStates)

Initiates a drag-and-drop operation.

Declaration

cs-api-definition
public static void DoDragDrop(DependencyObject dragSource, object data, DragDropEffects allowedEffects, DragDropKeyStates initialKeyState)

Parameters

dragSource

DependencyObject

A reference to the dependency object that is the source of the data being dragged.

data

object

A data object that contains the data being dragged.

allowedEffects

DragDropEffects

One of the System.Windows.DragDropEffects values that specifies permitted effects of the drag-and-drop operation.

initialKeyState

DragDropKeyStates

The initial key state when the drag operation begins.

DoDragDrop(DependencyObject, object, DragDropEffects, DragDropKeyStates, object, Point, Point)

Initiates a drag-and-drop operation.

Declaration

cs-api-definition
public static void DoDragDrop(DependencyObject dragSource, object data, DragDropEffects allowedEffects, DragDropKeyStates initialKeyState, object dragVisual, Point relativeStartPoint, Point dragVisualOffset)

Parameters

dragSource

DependencyObject

A reference to the dependency object that is the source of the data being dragged.

data

object

A data object that contains the data being dragged.

allowedEffects

DragDropEffects

One of the System.Windows.DragDropEffects values that specifies permitted effects of the drag-and-drop operation.

initialKeyState

DragDropKeyStates

The initial key state when the drag operation begins.

dragVisual

object

The object to show while drag-and-drop operation is in progress.

relativeStartPoint

Point

Cursor offset relative to dragSource element.

dragVisualOffset

Point

DragVisual offset relative to dragSource element.

GetAllowCapturedDrag(DependencyObject)

Gets a value indicating whether this element can raise DragInitialize event and be used as the source of a drag-and-drop operation.

Declaration

cs-api-definition
public static bool GetAllowCapturedDrag(DependencyObject obj)

Parameters

obj

DependencyObject

The object from which the property value is read.

Returns

bool

True if element can start automatic drag-and-drop operation, otherwise False. The default value is False.

GetAllowDrag(DependencyObject)

Gets a value indicating whether this element can raise DragInitialize event and be used as the source of a drag-and-drop operation.

Declaration

cs-api-definition
public static bool GetAllowDrag(DependencyObject obj)

Parameters

obj

DependencyObject

The object from which the property value is read.

Returns

bool

True if element can start automatic drag-and-drop operation, otherwise False. The default value is False.

RemoveDragDropCompletedHandler(DependencyObject, DragDropCompletedEventHandler)

Removes a DragDropCompleted event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemoveDragDropCompletedHandler(DependencyObject element, DragDropCompletedEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

DragDropCompletedEventHandler

A delegate that references the handler method to be removed.

Remarks

The DragDropCompleted event occurs when an drag-and-drop operation ends(On Drop or Cancel).

RemoveDragEnterHandler(DependencyObject, DragEventHandler)

Removes a DragEnter event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemoveDragEnterHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

DragEventHandler

A delegate that references the handler method to be removed.

Remarks

The DragEnter event occurs when an object is dragged into the element's bounds. This method removes a handler for the bubbling version of the DragEnter event. To remove a handler for the tunneling version of this event, see RemovePreviewDragEnterHandler.

RemoveDragInitializeHandler(DependencyObject, DragInitializeEventHandler)

Removes a DragInitialize event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemoveDragInitializeHandler(DependencyObject element, DragInitializeEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

DragInitializeEventHandler

A delegate that references the handler method to be removed.

Remarks

The DragInitialize event occurs when an object is about to be dragged. All needed information about the drag should be passed to the event arguments. Drag start can be stopped by setting Cancel=true.

RemoveDragLeaveHandler(DependencyObject, DragEventHandler)

Removes a DragLeave event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemoveDragLeaveHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

DragEventHandler

A delegate that references the handler method to be removed.

Remarks

The DragLeave event occurs when an object is dragged out of the element's bounds. This method removes a handler for the bubbling version of the DragLeave event. To remove a handler for the tunneling version of this event, see RemovePreviewDragLeaveHandler.

RemoveDragOverHandler(DependencyObject, DragEventHandler)

Removes a DragOver event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemoveDragOverHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

DragEventHandler

A delegate that references the handler method to be removed.

Remarks

The DragOver event occurs when an object is dragged over the element's bounds. This method removes a handler for the bubbling version of the DragOver event. To remove a handler for the tunneling version of this event, see RemovePreviewDragOverHandler.

RemoveDropHandler(DependencyObject, DragEventHandler)

Removes a Drop event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemoveDropHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

DragEventHandler

A delegate that references the handler method to be removed.

Remarks

The Drop event occurs when an object is dropped within an element's bounds. This method removes a handler for the bubbling version of the Drop event. To remove a handler for the bubbling version of this event, see RemovePreviewDropHandler.

RemoveGiveFeedbackHandler(DependencyObject, GiveFeedbackEventHandler)

Removes a GiveFeedback event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemoveGiveFeedbackHandler(DependencyObject element, GiveFeedbackEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

GiveFeedbackEventHandler

A delegate that references the handler method to be removed.

Remarks

The GiveFeedback event occurs during a drag operation. This method removes a handler for the bubbling version of the GiveFeedback event. To remove a handler for the tunneling version of this event, see RemovePreviewGiveFeedbackHandler.

RemovePreviewDragEnterHandler(DependencyObject, DragEventHandler)

Removes a PreviewDragEnter event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemovePreviewDragEnterHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

DragEventHandler

A delegate that references the handler method to be removed.

Remarks

The PreviewDragEnter event occurs when an object is dragged into the element's bounds. This method removes a handler for the tunneling version of the PreviewDragEnter event. To remove a handler for the bubbling version of this event, see RemoveDragEnterHandler.

RemovePreviewDragLeaveHandler(DependencyObject, DragEventHandler)

Removes a PreviewDragLeave event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemovePreviewDragLeaveHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

DragEventHandler

A delegate that references the handler method to be removed.

Remarks

The PreviewDragLeave event occurs when an object is dragged out of the element's bounds. This method removes a handler for the tunneling version of the PreviewDragLeave event. To remove a handler for the bubbling version of this event, see RemoveDragLeaveHandler.

RemovePreviewDragOverHandler(DependencyObject, DragEventHandler)

Removes a PreviewDragOver event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemovePreviewDragOverHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

DragEventHandler

A delegate that references the handler method to be removed.

Remarks

The PreviewDragOver event occurs when an object is dragged over the element's bounds. This method removes a handler for the tunneling version of the PreviewDragOver event. To remove a handler for the bubbling version of this event, see RemoveDragOverHandler.

RemovePreviewDropHandler(DependencyObject, DragEventHandler)

Removes a PreviewDrop event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemovePreviewDropHandler(DependencyObject element, DragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

DragEventHandler

A delegate that references the handler method to be removed.

Remarks

The PreviewDrop event occurs when an object is dropped within an element's bounds. This method removes a handler for the tunneling version of the PreviewDrop event. To remove a handler for the bubbling version of this event, see RemoveDropHandler.

RemovePreviewGiveFeedbackHandler(DependencyObject, GiveFeedbackEventHandler)

Removes a PreviewGiveFeedback event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemovePreviewGiveFeedbackHandler(DependencyObject element, GiveFeedbackEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

GiveFeedbackEventHandler

A delegate that references the handler method to be removed.

Remarks

The PreviewGiveFeedback event occurs during a drag operation. This method removes a handler for the tunneling version of the PreviewGiveFeedback event. To remove a handler for the bubbling version of this event, see RemoveGiveFeedbackHandler.

RemovePreviewQueryContinueDragHandler(DependencyObject, QueryContinueDragEventHandler)

Removes a PreviewQueryContinueDrag event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemovePreviewQueryContinueDragHandler(DependencyObject element, QueryContinueDragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

QueryContinueDragEventHandler

A delegate that references the handler method to be removed.

Remarks

The PreviewQueryContinueDrag event occurs during a drag-and-drop operation, and enables the drag source to determine whether the drag-and-drop operation should be canceled. This method removes a handler for the tunneling version of the PreviewQueryContinueDrag event. To remove a handler for the bubbling version of this event, see RemoveQueryContinueDragHandler.

RemoveQueryContinueDragHandler(DependencyObject, QueryContinueDragEventHandler)

Removes a QueryContinueDrag event handler from a specified dependency object.

Declaration

cs-api-definition
public static void RemoveQueryContinueDragHandler(DependencyObject element, QueryContinueDragEventHandler handler)

Parameters

element

DependencyObject

The dependency object (a UIElement or ContentElement) from which to remove the event handler.

handler

QueryContinueDragEventHandler

A delegate that references the handler method to be removed.

Remarks

The QueryContinueDrag event occurs during a drag-and-drop operation, and enables the drag source to determine whether the drag-and-drop operation should be canceled. This method removes a handler for the bubbling version of the QueryContinueDrag event. To remove a handler for the tunneling version of this event, see RemovePreviewQueryContinueDragHandler.

SetAllowCapturedDrag(DependencyObject, bool)

Sets a value indicating whether this element can raise DragInitialize event and be used as the source of a drag-and-drop operation. When set the dragged element will steal mouse capture (WPF only).

Declaration

cs-api-definition
public static void SetAllowCapturedDrag(DependencyObject obj, bool value)

Parameters

obj

DependencyObject

The object on which to set the value.

value

bool

Boolean value specifying if this element can automatically raise DragInitialize event and be used as the source of a drag-and-drop operation and steal mouse capture.

SetAllowDrag(DependencyObject, bool)

Sets a value indicating whether this element can raise DragInitialize event and be used as the source of a drag-and-drop operation.

Declaration

cs-api-definition
public static void SetAllowDrag(DependencyObject obj, bool value)

Parameters

obj

DependencyObject

The object on which to set the value.

value

bool

Boolean value specifying if this element can automatically raise DragInitialize event and be used as the source of a drag-and-drop operation.

In this article
DefinitionFieldsAllowCapturedDragPropertyAllowDragPropertyPropertiesDefaultDragDropEffectsIsDragInProgressIsFullTrustMinimumHorizontalDragDistanceMinimumVerticalDragDistanceUseAdornerLayerMethodsAddDragDropCompletedHandler(DependencyObject, DragDropCompletedEventHandler)AddDragDropCompletedHandler(DependencyObject, DragDropCompletedEventHandler, bool)AddDragEnterHandler(DependencyObject, DragEventHandler)AddDragEnterHandler(DependencyObject, DragEventHandler, bool)AddDragInitializeHandler(DependencyObject, DragInitializeEventHandler)AddDragInitializeHandler(DependencyObject, DragInitializeEventHandler, bool)AddDragLeaveHandler(DependencyObject, DragEventHandler)AddDragLeaveHandler(DependencyObject, DragEventHandler, bool)AddDragOverHandler(DependencyObject, DragEventHandler)AddDragOverHandler(DependencyObject, DragEventHandler, bool)AddDropHandler(DependencyObject, DragEventHandler)AddDropHandler(DependencyObject, DragEventHandler, bool)AddGiveFeedbackHandler(DependencyObject, GiveFeedbackEventHandler)AddGiveFeedbackHandler(DependencyObject, GiveFeedbackEventHandler, bool)AddPreviewDragEnterHandler(DependencyObject, DragEventHandler)AddPreviewDragEnterHandler(DependencyObject, DragEventHandler, bool)AddPreviewDragLeaveHandler(DependencyObject, DragEventHandler)AddPreviewDragLeaveHandler(DependencyObject, DragEventHandler, bool)AddPreviewDragOverHandler(DependencyObject, DragEventHandler)AddPreviewDragOverHandler(DependencyObject, DragEventHandler, bool)AddPreviewDropHandler(DependencyObject, DragEventHandler)AddPreviewDropHandler(DependencyObject, DragEventHandler, bool)AddPreviewGiveFeedbackHandler(DependencyObject, GiveFeedbackEventHandler)AddPreviewGiveFeedbackHandler(DependencyObject, GiveFeedbackEventHandler, bool)AddPreviewQueryContinueDragHandler(DependencyObject, QueryContinueDragEventHandler)AddPreviewQueryContinueDragHandler(DependencyObject, QueryContinueDragEventHandler, bool)AddQueryContinueDragHandler(DependencyObject, QueryContinueDragEventHandler)AddQueryContinueDragHandler(DependencyObject, QueryContinueDragEventHandler, bool)DoDragDrop(DependencyObject, object, DragDropEffects, DragDropKeyStates)DoDragDrop(DependencyObject, object, DragDropEffects, DragDropKeyStates, object, Point, Point)GetAllowCapturedDrag(DependencyObject)GetAllowDrag(DependencyObject)RemoveDragDropCompletedHandler(DependencyObject, DragDropCompletedEventHandler)RemoveDragEnterHandler(DependencyObject, DragEventHandler)RemoveDragInitializeHandler(DependencyObject, DragInitializeEventHandler)RemoveDragLeaveHandler(DependencyObject, DragEventHandler)RemoveDragOverHandler(DependencyObject, DragEventHandler)RemoveDropHandler(DependencyObject, DragEventHandler)RemoveGiveFeedbackHandler(DependencyObject, GiveFeedbackEventHandler)RemovePreviewDragEnterHandler(DependencyObject, DragEventHandler)RemovePreviewDragLeaveHandler(DependencyObject, DragEventHandler)RemovePreviewDragOverHandler(DependencyObject, DragEventHandler)RemovePreviewDropHandler(DependencyObject, DragEventHandler)RemovePreviewGiveFeedbackHandler(DependencyObject, GiveFeedbackEventHandler)RemovePreviewQueryContinueDragHandler(DependencyObject, QueryContinueDragEventHandler)RemoveQueryContinueDragHandler(DependencyObject, QueryContinueDragEventHandler)SetAllowCapturedDrag(DependencyObject, bool)SetAllowDrag(DependencyObject, bool)
Not finding the help you need?
Contact Support