Question

I used MouseDragElementBehavior to let user drag & drop Shapes on a Canvas:

MouseDragElementBehavior dragBehavior = new MouseDragElementBehavior();
dragBehavior.Attach(myShape);

Now, I would like to know when myShape was moved and when myShape was dropped. Could you please suggest a code that prints the mouse coordinates when myShape is moved, and prints "Dropped" when myShape is dropped ? Thank you so much !

Was it helpful?

Solution

MouseDragElementBehavior class has

  • DragBegun
  • DragFinished
  • Dragging

events. I believe subscribing to those would do what you need

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top