230
|
Chapter 11: Animations and Transformations
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
<SplineThicknessKeyFrame.KeySpline>
<KeySpline ControlPoint1="5,5" ControlPoint2="10,10" />
</SplineThicknessKeyFrame.KeySpline>
</SplineThicknessKeyFrame>
All three ThicknessKeyFrame subclasses determine when (KeyTime) the frame will reach
the designated value (
Value). KeyTime is specified in terms of hours:minutes:seconds.
The
Value attribute of all ThicknessKeyFrame subclasses is a Thickness.
DiscreteThicknessKeyFrame
Skips from one value to the desired value without interpolation. Thus, the Value
will not be reached until KeyTime (relative to the beginning of the animation).
LinearThicknessKeyFrame
Utilizes linear interpolation to reach the desired value. Linear interpolation
progresses the animation at a steady rate for its duration.
SplineThicknessKeyFrame
Uses a concept similar to Bezier curves to interpolate values until Value has been
reached. This subclass requires an additional attribute,
KeySpline, which is used
to interpolate the value in much the same way as control points are used to inter-
polate a line when declaring a Bezier curve.
The
Thickness value may be specified using abbreviated markup syntax or explicitly
declared as a
Thickness element.
Attributes
KeySpline (required) (SplineThicknessKeyFrame only)
This
KeySpline describes how the key frame will be altered during animation.
KeyTime (required)
This attribute specifies when, relative to the animation, this key frame takes place:
A time period specified in hours:minutes:seconds.
Uniform: The Duration will be split evenly among all key frames.
Paced: The Duration will be split among key frames in a way that ensures the
speed of the animation remains relatively constant.
A percentage of the total duration.
Value (required)
This
Thickness describes the destination value of the key frame.
Timeline
Hierarchy: DependencyObject Freezable Animatable
<Timeline
AccelerationRatio="1"
AutoReverse="true|false"
BeginTime="100"
CutOffTime="300"
FillBehavior="Deactivate|HoldEnd"
DecelerationRatio="1"
Duration="Automatic|Forever|100"
RepeatBehavior="IterationCount|RepeatDuration|Forever"
SpeedRatio="0.5" />
Timeline | 231
Animating
Elements
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
<Timeline .../> is an abstract element that represents a time period. Timeline makes
use of the
TimeSpan structure, which is represented textually as “d:h:s,” where “d” is
the number of days, “h” is the number of hours, and “s” is the number of seconds.
Attributes
AccelerationRatio (optional)
This
Double value represents the percentage of the Duration spent accelerating
from zero to its maximum rate. This attribute must be set to a value between 0
and 1, inclusive. The default value is 0.
AutoReverse (optional)
This
Boolean value determines whether the timeline will play in reverse after it has
completed a forward iteration.
true
The timeline will play in reverse at the end of each forward iteration.
false
The timeline will not play in reverse. This is the default value.
BeginTime (optional)
This
TimeSpan attribute determines when the timeline will begin. The default
value is 0.
CutOffTime (optional)
This
TimeSpan attribute determines when the timeline should end, relative to
BeginTime.
DecelerationRatio (optional)
This
Double value represents the percentage of the Duration spent decelerating
from its maximum rate to zero. This attribute must be set to a value between 0
and 1, inclusive. The default value is 0.
Duration (optional)
This attribute determines how long the timeline should continue, not counting
repetitions.
Automatic
The timeline automatically ends when its last child stops playing.
Forever
The timeline will continue playing indefinitely.
TimeSpan
The value of this attribute is a time span.
FillBehavior (optional)
This value determines how the animation will behave once it has completed but
while its parent is still active.
Deactivate
The Timeline is turned off when its parent is no longer active.
HoldEnd
The Timeline holds its progress until the end of its parent’s active and hold
periods.
RepeatBehavior (optional)
This attribute determines how the timeline will repeat its
Duration, if at all.

Get XAML in a Nutshell 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.