Skip to main content

Microsoft Silverlight

Answered Question MouseEnter event handler questionRSS Feed

(0)

JimInSF
JimInSF

Member

Member

0 points

1 Posts

MouseEnter event handler question

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
lingbing

Contributor

Contributor

2249 points

406 Posts

Answered Question

Re: MouseEnter event handler question

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!

Ling Bing
Bei Jing University of Aeronautics and Astronautics
Bei Jing, China
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities