DragEventHandler DragEventHandler DragEventHandler DragEventHandler Delegate


Represents the method that will handle the DragEnter, DragLeave, DragOver, and Drop events of a UIElement.

public : delegate void DragEventHandler(Platform::Object sender, DragEventArgs e)
struct DragEventHandler : winrt::Windows::Foundation::IUnknown
   DragEventHandler(std::nullptr_t = nullptr) noexcept;
   template <typename L> DragEventHandler(L lambda);
   template <typename F> DragEventHandler(F* function);
   template <typename O, typename M> DragEventHandler(O* object, M method);
   void operator()(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::DragEventArgs const& e) const;
public delegate void DragEventHandler(Object sender, DragEventArgs e)
Public Delegate Sub DragEventHandler(sender As Object, e As DragEventArgs)


Object Object

The object where the event handler is attached.

DragEventArgs DragEventArgs

The event data.


Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


DragEventHandler is the delegate you implement to handle these events:

The Control class has pre-wired event handlers that Control derived types can override to provide class-based handling for the drag-drop events,. 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.

See also