Discrete Keyframes

A discrete keyframe indicates that no interpolation should be done from the previous keyframe. Updating DoubleAnimationUsingKeyFrames from Listing 16.1 as follows produces the motion illustrated in Figure 16.11:

<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Top)"   Duration="0:0:3">   <Discrete DoubleKeyFrame Value="0" KeyTime="0:0:0"/>   <Discrete DoubleKeyFrame Value="200" KeyTime="0:0:1"/>   <Discrete DoubleKeyFrame Value="0" KeyTime="0:0:2"/>   <Discrete DoubleKeyFrame Value="200" KeyTime="0:0:3"/> </DoubleAnimationUsingKeyFrames>

Image

FIGURE 16.11 Discrete keyframes makes the ...

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.