views:

26

answers:

1

I am developing a small application with images and trash box icon on right hand bottom.

I have multiple images floating in the main window, and using mouse I can move image from one corner to other corner of window, left, right, top and bottom.

I can't figure out how do I catch an event when a image touches and panel (with trash box image), in the right hand corner.

Does anybody knows which event or handler to listen? This is not a drag and drop case since my images are floating so no point using drag and drop.

Thank you

+1  A: 

Per this thread (MSDN), you could listen to an event fired when your image moves, and get Rects representing the trash box and the image, then use the IntersectsWith() method to detect if they are "touching".

Other than that, there are the UIElement events DragEnter, DragOver, and Drop (as well as their Preview___ counterparts) which might fit the bill. However, those are part of drag-and-drop. I'm not convinced that drag-and-drop is not appropriate in this situation. It sounds like drag and drop to me.

Benny Jobigan
Thanks buddy it helped me a lot.
Raghav