views:

39

answers:

1

I have two UI elements next to each other that I want to behave as if they are one MouseLeave area.

How can I check if the mouse is over a UI element being entered during a MouseLeave event?

Currently, checking the mouse position using the following solution shows the mouse over the element being left during the MouseLeave event: http://forums.silverlight.net/forums/p/193378/448518.aspx.

Thank you.

A: 

I don't know if the event order is deterministic, so I don't know if you can do exactly what you are describing. You might be able to do it with some weird code. For example, you could try making a UI element hit-test function, and checking it during the mouse leave event handler. This would not be very flexible code.

I haven't tried this, but you could probably solve this problem by containing both UI elements in a parent element, such as a grid, and adding your event handlers to that parent. That would be much simpler, and much more flexible.

Merlyn Morgan-Graham