Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit MouseEnter event handler question
1 replies. Latest Post by lingbing on March 8, 2009.
(0)
JimInSF
Member
0 points
1 Posts
03-08-2009 10:37 PM |
In my Silverlight applet, I have a bouncing ball over an image. The structure of the view is something like this:
<Grid ...>
<Image ... />
<Ellipse ... />
</Grid>
The "bouncing ball" effect is created by animating the position of the Ellipse through a TranslationTransform.
The applet can be viewed at
http://cross-comp.com/silverlight2/famouscat.aspx
It has a problem. I want to use MouseEnter on the Image to control the content of a TextBlock but I don't want the Ellipse to react to the MouseEnter event. I need something like event tunneling so that MouseEnter is handled as an Image property but not as an Ellipse property.
I think I can pull this off in WPF with a Window as top container. But I can't make it happen in Silverlight with a UserControl top container.
What am I doing wrong?
Jim
lingbing
Contributor
2249 points
406 Posts
03-08-2009 11:04 PM |
Hi, if you just don't want that Ellipse object not to handle MouseEnter and other mouse events, please set its IsHitTestVisible property as false, then the mouse events will not fire, and that ellipse will not react to the MouseEnter event.
Regards!