Discrete Keyframes
A discrete keyframe indicates that no interpolation should be done from the previous keyframe. Updating DoubleAnimationUsingKeyFrames
from Listing 19.1 as follows produces the motion illustrated in Figure 19.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>
Get XAML 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.