15.02.2015 Views

C# 4 and .NET 4

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

animations ❘ 1025<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Figure 35-33 shows the output after running the<br />

application.<br />

Instead of starting <strong>and</strong> stopping the animation<br />

directly from event triggers in XAML, you can<br />

easily control the animation from code-behind.<br />

You just need to assign a name to the Storyboard<br />

<strong>and</strong> invoke the Begin(), Stop(), Pause(), <strong>and</strong><br />

Resume() methods.<br />

code snippet AnimationDemo/EventTriggerWindow.xaml<br />

Keyframe animations<br />

With acceleration <strong>and</strong> deceleration ratio as well as<br />

the ease functions, you’ve seen how animations<br />

can be built in a non-linear fashion. If you need<br />

to specify several values for an animation,<br />

you can use keyframe animations. As with<br />

normal animations, keyframe animations are<br />

different animation types that exist to animate<br />

properties of different types.<br />

figure 35-33<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!