Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 2.85 KB

drageventargs.md

File metadata and controls

40 lines (26 loc) · 2.85 KB
-api-id -api-type
T:Microsoft.UI.Xaml.DragEventArgs
winrt class

Microsoft.UI.Xaml.DragEventArgs

-description

Provides data for drag-and-drop events.

-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. For a list item drag-drop action, the Data value in event data can potentially be modified from the control-defined default data about the item. This is done by handling the DragItemsStarting event, and working with the DataPackage object that is obtained from the DragItemsStartingEventArgs.Data property in the event data.

-examples

-see-also

Drag-and-drop overview, RoutedEventArgs, ListViewBase, UIElement, AllowDrop, Drag and drop sample (Windows 10)