user242408
user242408

Reputation:

Drag & Drop Shapes on Canvas

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 !

Upvotes: 0

Views: 708

Answers (1)

serge_gubenko
serge_gubenko

Reputation: 20482

MouseDragElementBehavior class has

  • DragBegun
  • DragFinished
  • Dragging

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

Upvotes: 1

Related Questions