tags:

views:

436

answers:

1

I am using CaptureMouse() during a drag and drop operation to make sure I don't miss the MouseUp event, but this seems to prevent any mouse events reaching any other objects on my Canvas. This means that my IsMouseOver based triggers don't work, but I need them to indicate valid locations where the object can be dropped.

Am I doing this wrong, or is there a way of making sure everything on my Canvas still gets mouse events?

+3  A: 

Are the elements part of the SubTree of your canvas? or outside of the canvas? If they are within then you could probably use the Capture method that takes a CaptureMode.

Mouse.Capture(elementToCapture, CaptureMode.SubTree);

Alternatively, you should look at the DragDrop class and consider using the Drop event instead?

Todd White
The first option worked, as long as I offset the dragged connection slightly so it wasn't underneath the mouse while it was being dragged. Thanks!
Jamie Penney