Why you should develop systems in WPF, not WinForms
Part of a -part series of blogs

Posted by Andy Brown on 25 September 2012

You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

9 - StoryBoards and Animations

This is where WPF stops being a productive business tool, and starts being fun.  You can download the window used by this page here.

Bouncing ball window

In this window, clicking on the Start button will make the ball travel to and fro across the window, and also make the word Bounce gradually build up across the bottom of the window.

 

Here's the storyboard at the heart of this which makes the ball move:

A storyboard in WPF

Change the Left property of the object called Ball to 200 pixels, taking 1.4 seconds to do it.

 

When the animation is complete we reverse it automatically, and repeat this animation forever.

Animations in WPF look nice because everything is drawn and scaled correctly.  This is because WPF uses vector graphics - which brings us to our 10th and final advantage.

This blog has 0 threads Add post