How can I pass a mouse click to a parent control?

Posted by grimus on Stack Overflow See other posts from Stack Overflow or by grimus
Published on 2009-07-09T22:05:36Z Indexed on 2010/03/24 0:03 UTC
Read the original article Hit count: 346

Filed under:
|

In a Silverlight 2 app, I am using Rectangles on a Canvas to draw a representation of data. I would like to have mouse clicks on the Rectangles be passed on to the control that owns the Canvas. I would also like to be able to show a tooltip with a summary of the data when the mouse is over a Rectangle.

So far I've only been able to achieve one item or the other. If I make the Rectangles have their IsHitTestVisible property = false, the tooltips don't work, but the owning control will receive the mouse clicks. If I set it to true, then tooltips do work, but the clicks don't get passed on.

Is there a way to have a Silverlight item be IsHitTestvisible = true, and pass on the mouse clicks?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about gui