Revisiting UIElement Gesture Events
UIElement
exposes some additional mouse (and pen)-specific gesture routed events that are all related to the lower-level Dragging
event:
→ DragOver and Drop—Maps to Dragging
events with states of Started
/Continuing
and Completed
, respectively
→ DragEnter and DragLeave—Like PointerEntered
and PointerExited
, but raised only when dragging (meaning a mouse button is depressed)
These events only work in limited contexts, however. To see them raised on a drop target, its AllowDrop
property (or an ancestor’s) must be set to true
. Furthermore, the drop source must be made draggable. For example, it could be an element inside a GridView
(covered in Chapter 10, “Items Controls”) with its CanDragItems
property set to ...
Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.