O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Manual Animations

Of course, even with all the fancy animation support discussed in this chapter, nothing prevents you from animating the old-fashioned way. The classic way to implement animations such as the ones in this chapter is to set up a timer and a callback function that is periodically called based on the frequency of the timer. Inside the callback function, you can manually update the target property (doing a little math to determine the current value based on the elapsed time) until it reaches the final value. At that point, you can stop the timer and/or remove the event handler.

Thanks to the retained-mode graphics model, this approach doesn’t take much work. All the XAML-based frameworks even have their own DispatcherTimer class ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required