Linear Keyframes

Listing 16.1 uses DoubleAnimationUsingKeyFrames to help move a circle (Ellipse) in a zigzag pattern, as illustrated in Figure 16.9. The blue lines are there to show the path that the circle travelled to get to its final spot. Because the Image is inside a Canvas, the motion is accomplished by animating the Canvas.Left and Canvas.Top attached properties rather than using the more versatile TranslateTransform. These are still independent animations, however!

Image

FIGURE 16.9 Zigzag motion is easy to create with a keyframe animation.

LISTING 16.1 The Zigzag Animation for Figure 16.9

<Page ...>   <Page.Resources ...

Get Universal Windows® Apps with XAML and C# Unleashed 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.