XAML Bouncing Ball Storyboard

Hmm how to explain ?  

An Ellipse is moving across the screen and when it 'hits' the edge of the screen, it changes direction (angle of incidence = angle of reflection etc)

How can I mimic this behaviour as part of an XAML Storyboard ?

(is there no Silverlight Topic?)
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Randy DownsOWNERCommented:
Try this.

   private void rectangle1_MouseDown(object sender, MouseButtonEventArgs e) 
            ThicknessAnimation bounceAnimation = new ThicknessAnimation(); 
            BounceEase BounceOrientation = new BounceEase(); 
            BounceOrientation.Bounces = 4; 
            BounceOrientation.Bounciness = 2; 
            bounceAnimation.To = new Thickness(143,200,0,0); 
            bounceAnimation.From = new Thickness(143,0,0,0); 
            bounceAnimation.EasingFunction = BounceOrientation; 
            rectangle1.BeginAnimation(MarginProperty, bounceAnimation); 

Open in new window

<Window x:Class="WpfApplication1.MainWindow" 
        Title="MainWindow" Height="350" Width="525"> 
        <Rectangle Name="myRectangle" Width="200" Height="30" Fill="Blue"> 
                <EventTrigger RoutedEvent="Rectangle.MouseDown"> 
                            <Storyboard x:Name="myStoryboard"> 
                                <DoubleAnimation From="30" To="200" Duration="00:00:3"  
                                        <BounceEase Bounces="2" EasingMode="EaseOut"  
                             Bounciness="3" /> 

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
WatersideAuthor Commented:
Hi. Sorry.. I haven't neglected this.. Just side tracked with other jobs.. I'll test it when I have a minute free tnx
Randy DownsOWNERCommented:
This should have worked

Great sample I'm using it for a project, it is amazing and very easy to implement
Randy DownsOWNERCommented:
This should have worked

Great sample I'm using it for a project, it is amazing and very easy to implement
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.