It's Alive! (Or, How I Learned to Stop Worrying and Love Animation)
XAML is a very powerful declarative language. As we have seen, it allows you to create complex layouts and absorb resources both locally and remotely. But one of the truly amazing things about XAML is that it enables you to animate your user experience.
Our next example will demonstrate how to animate a fairly simple window, with a focus on the nuts and bolts of animation. The XAML code might seem a little daunting at first, but hang in there; you'll come to see that most of it has to do with positioning and the timing of effects.
When you run this example, you should notice that the user interface elements fade in rather than appearing abruptly, and that the artwork in the product name banner is gently animated.
The human eye can process visual information at an astonishing rate, but there are limits. Traditionally, most applications present all UI elements simultaneously. The overloaded eye doesn't know where to look first, and the user is temporarily overwhelmed. By making the UI elements appear in a logical sequence, you can help the user see the story of your presentation.
Animation Overview
We'll go into animation in more detail in the next chapter, but we want to give you a taste now of how much you can do with XAML. Some of the concepts illustrated here aren't discussed fully until the next chapter. Bear with us; they'll be made clear soon.
Two techniques are used for animation. In the first, known as From/To/By ...
Get Programming .NET 3.5 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.