WPF Reflections

Jun 15 2008   8:52PM GMT

WPF Animation timeline

Mark Shurmer Profile: MarkWPF

All of the interesting WPF classes derive from the TimeLine class.

What do I mean by interesting?

All of the classes for animating different types (like DoubleAnimation and ColorAnimation), MediaTimeLine (for playing videos and audio) and TimeLineGroup from which StoryBoard (which provides the canvas for running animations) is derived.

Also, the TimeLine class itself has some key properties which bear noting:

  • Duration – length of time the animation runs, used by most of its children
  • SpeedRatio – increases or decreases the speed of the animation. It defaults to 1, setting it to 5 runs the animation 5 times faster and setting it to 0.5 makes the animation twice as slow
  • AccelerationRatio -changes the relative speed of the animation, so that it starts slowly and speeds up. You specify values between 0 and 1, where 0 keeps the animation constant and 1 accelerates it towards the end
  • DecelerationRatio – does the opposite of AccelerationRatio, i.e. makes the animation slow down near the end
  • AutoReverse – will make the animation reverse after it finishes, if set to true
  • BeginTime – allows you to specify a delay before the animation starts
  • FillBehaviour – specifies what happens when the animation finishes, e.g. hold the value or revert back to the original value
  • RepeatBehaviour -gives the animation instructions on how many times to repeat the animation or for how long

 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: