Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DragEventArgs class

Provides data for drag-and-drop events.

Inheritance

Object
  RoutedEventArgs
    DragEventArgs

Syntax


public sealed class DragEventArgs : RoutedEventArgs

Members

The DragEventArgs class has these types of members:

Methods

The DragEventArgs class has these methods. It also inherits methods from the Object class.

MethodDescription
GetPosition Returns a drop point that is relative to a specified UIElement.

 

Properties

The DragEventArgs class has these properties.

PropertyAccess typeDescription

Data

Read/writeGets or sets a data object (DataPackage) that contains the data associated with the corresponding drag event. This value is not useful in all event cases; specifically, the event must be handled by a valid drop target.

Handled

Read/writeGets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.

OriginalSource

Read-onlyGets a reference to the object that raised the event. This is often a template part of a control rather than an element that was declared in your app UI. (Inherited from RoutedEventArgs)

 

Remarks

DragEventArgs is used as event data for these events:

These events are routed events. Changing the value of the Handled property of DragEventArgs from an event handler can influence how a routed event behaves. For more info on the routed event concept, see Events and routed events overview.

The Control class has pre-wired event handlers that Control derived types can override to provide class-based handling for the drag-drop events, and these methods also use DragEventArgs as a parameter. These methods are:

The Windows Runtime implementation of drag-drop concepts permits only certain controls and input actions to initiate a drag-drop action. There is no generalized DoDragDrop method that would permit any UI element to initiate a drag-drop action. The main source of a drag-drop action is when you drag the items of a list such as GridView.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml
Windows::UI::Xaml [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml
Windows::UI::Xaml [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

See also

Object
RoutedEventArgs
ListViewBase
UIElement
AllowDrop

 

 

Show:
© 2015 Microsoft