During a drag in Wpf, how can the mouse cursor (or perhaps using an adorner) be changed to indicate that the droptarget
will not accept the dragged item?
I've tried to set e.Effects = DragDropEffects.None
during the DragEnter
event but this isn't working and I suspect that I've misunderstood what that feature should be used for. I've tried using the GiveFeedback
event but don't see how the droptarget
can influence it.
Just setting the DragDropEffects in DragEnter of the drop target should work. Is your DragEnter even getting called. Have you set AllowDrop on the drop target control?
This is the sequence of events during a drag & drop in WPF (taken from MSDN) which might help work out what's going on...
Dragging is initiated by calling the DoDragDrop method for the source control.
The DoDragDrop method takes two parameters: * data, specifying the data to pass * allowedEffects, specifying which operations (copying and/or moving) are allowed
A new DataObject object is automatically created.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With