Take the 2-minute tour ×

I have a red border moved by an animation (with a RenderTransform) and the blue border underneath is handling the MouseEnter event.

Unfortunately, the MouseEnter is not fired when the mouse enters the blue border (because the red border has moved away) but when the mouse is moved.

The sample below is tested in Silverlight but I believe the same happens in WPF.

EDIT: after further testing this works in WPF. Is this a bug as MrJul suggests or one of the "missing features" in Silverlight?


<Grid x:Name="borders" Width="40" Height="20">
        <Storyboard x:Key="blueMove">
            <DoubleAnimation Duration="0:0:3" From="0" To="40" Storyboard.TargetName="redBorder"
    <Border Background="Blue" MouseEnter="Border_MouseEnter" />
    <Border x:Name="redBorder" Background="Red" MouseLeftButtonDown="Border_MouseLeftButtonDown">
                <TranslateTransform Y="0"/>

C# code behind

private void Border_MouseEnter(object sender, MouseEventArgs e)
 // Only called at the first MouseMove

private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 (borders.Resources["blueMove"] as Storyboard).Begin();
share|improve this question
I just submitted this as a bug on connect.microsoft.com, but I'm still looking for a workaround. –  Mart Oct 3 '09 at 8:58
Microsoft Connect sent the following comment: "We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution." which doesn't mean this has been accepted as a bug. –  Mart Oct 7 '09 at 11:30
Microsoft Connect finally sent a disappointing answer: this is a known issue (but not a bug). Indeed as stated on MouseEnter event page (msdn.microsoft.com/en-us/library/…): "MouseEnter is not raised if the mouse pointer (or the stylus tip) remains stationary, and an object with a MouseEnter handler has its position animated or otherwise adjusted to move under the mouse pointer" That means no solution for that problem. –  Mart Feb 1 '10 at 12:54
add comment

1 Answer

up vote 0 down vote accepted

This works fine in WPF but not in Silverlight so one would assume it's a possible bug in Silverlight. I'd suggest you fill an issue report on Connect.

share|improve this answer
Thanks MrJul. Before submitting this as a bug I would like to determine if this is not an intentionally missing feature in Silverlight. Also is it possible to have a workaround. I really can't think of a way to trigger the event once and the right time. –  Mart Oct 3 '09 at 7:15
You were right, but they call is an issue, not a bug. –  Mart Feb 1 '10 at 12:55
add comment

Your Answer


