Timeline Timeline Timeline Timeline Class
Defines a segment of time.
public ref class Timeline abstract : System::Windows::Media::Animation::Animatable
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)] [System.Windows.Markup.RuntimeNameProperty("Name")] public abstract class Timeline : System.Windows.Media.Animation.Animatable
type Timeline = class inherit Animatable
Public MustInherit Class Timeline Inherits Animatable
A timeline represents a segment of time. It provides properties that enable you to specify the length of that segment, when it should start, how many times it will repeat, how fast time progresses in that segment, and more.
Classes that inherit from the timeline class provide additional functionality, such as animation and media playback. The following are examples of some of the different types of specialized timelines available.
Animations: An AnimationTimeline is a type of timeline that produces output values. When you associate an animation with a property, the animation updates the property's value as it plays, thereby "animating" it. For an introduction to animations, see Animation Overview. For information about the different ways to apply animations, see the Property Animation Techniques Overview.
MediaTimelines: A MediaTimeline is a type of timeline that controls the playback of a media file.
ParallelTimelines: A ParallelTimeline is a type of timeline that groups other timelines.
Storyboards: A Storyboard is a special type of ParallelTimeline that provides object and property targeting information for the timelines it contains. For more information about Storyboard objects, see the Storyboards Overview.
Data Binding and Animating Timelines
Most timeline properties can be data bound or animated; however, because of the way the timing system works, data bound or animated timelines do not behave like other data bound or animated objects. To understand their behavior, it helps to understand what it means to activate a timeline.
When a timeline is applied, copies are made of the timeline and its child timelines. These copies are frozen (made read-only) and Clock objects are created from them. It's these clocks that do the actual work of animating the targeted properties. If a timeline was data bound or animated, a snapshot of its current values was made when its clock was created. Even though the original timeline might continue to change, its clock does not.
For a timeline to reflect data binding or animation changes, its clock must be regenerated. Clocks are not regenerated for you automatically. The following are several ways to apply timeline changes:
If the timeline is or belongs to a Storyboard, you can make it reflect changes by reapplying its storyboard using a BeginStoryboard or the Begin method. This has the side effect of also restarting the animation. In code, you can use the Seek method to advance the storyboard back to its previous position.
If you are working directly at the clock level, create and apply a new set of clocks and use them to replace the previous set of generated clocks.
For an example of a data bound animation, see the Key Spline Animation Sample .
Using a Timeline as a Timer
A timeline's clock will only progress when there's an event handler associated with it or (in the case of an AnimationClock object) it is associated with a property. For this reason (and others), it's not recommended that you use a Timeline as a timer.
|AccelerationRatio AccelerationRatio AccelerationRatio AccelerationRatio||
Gets or sets a value specifying the percentage of the timeline's Duration spent accelerating the passage of time from zero to its maximum rate.
|AutoReverse AutoReverse AutoReverse AutoReverse||
Gets or sets a value that indicates whether the timeline plays in reverse after it completes a forward iteration.
|BeginTime BeginTime BeginTime BeginTime||
Gets or sets the time at which this Timeline should begin.
|CanFreeze CanFreeze CanFreeze CanFreeze||
Gets a value that indicates whether the object can be made unmodifiable.(Inherited from Freezable)
|DecelerationRatio DecelerationRatio DecelerationRatio DecelerationRatio||
Gets or sets a value specifying the percentage of the timeline's Duration spent decelerating the passage of time from its maximum rate to zero.
|DependencyObjectType DependencyObjectType DependencyObjectType DependencyObjectType||
Gets the DependencyObjectType that wraps the CLR type of this instance.(Inherited from DependencyObject)
|Dispatcher Dispatcher Dispatcher Dispatcher||DispatcherObject)|
|Duration Duration Duration Duration||
Gets or sets the length of time for which this timeline plays, not counting repetitions.
|FillBehavior FillBehavior FillBehavior FillBehavior||
Gets or sets a value that specifies how the Timeline behaves after it reaches the end of its active period.
|HasAnimatedProperties HasAnimatedProperties HasAnimatedProperties HasAnimatedProperties||
Gets a value that indicates whether one or more AnimationClock objects is associated with any of this object's dependency properties.(Inherited from Animatable)
|IsFrozen IsFrozen IsFrozen IsFrozen||
Gets a value that indicates whether the object is currently modifiable.(Inherited from Freezable)
|IsSealed IsSealed IsSealed IsSealed||
Gets a value that indicates whether this instance is currently sealed (read-only).(Inherited from DependencyObject)
|Name Name Name Name||
Gets or sets the name of this Timeline.
|RepeatBehavior RepeatBehavior RepeatBehavior RepeatBehavior||
Gets or sets the repeating behavior of this timeline.
|SpeedRatio SpeedRatio SpeedRatio SpeedRatio||
Gets or sets the rate, relative to its parent, at which time progresses for this Timeline.
|DesiredFrameRate DesiredFrameRate DesiredFrameRate DesiredFrameRate||
Gets or sets the desired frame rate for this timeline and its child timelines.
|Changed Changed Changed Changed||
Occurs when the Freezable or an object it contains is modified.(Inherited from Freezable)
|Completed Completed Completed Completed||
Occurs when this timeline has completely finished playing: it will no longer enter its active period.
|CurrentGlobalSpeedInvalidated CurrentGlobalSpeedInvalidated CurrentGlobalSpeedInvalidated CurrentGlobalSpeedInvalidated||
Occurs when the rate at which time progresses for the timeline's clock changes.
|CurrentStateInvalidated CurrentStateInvalidated CurrentStateInvalidated CurrentStateInvalidated|
|CurrentTimeInvalidated CurrentTimeInvalidated CurrentTimeInvalidated CurrentTimeInvalidated|
|RemoveRequested RemoveRequested RemoveRequested RemoveRequested||
Occurs when the clock created for this timeline or one of its parent timelines is removed.