🔹 Clock Class
namespace Noesis | MSDN
Maintains run-time timing state for a Timeline.
A Timeline, by itself, doesn't actually do anything other than describe a segment of time. It's the timeline's Clock object that does the real work: it maintains timing-related run-time state for the timeline.
Although clocks are rarely controlled by the user in code (they are not visible from XAML) it's important to understand how they work.
Timelines deriving from AnimationTimeline are controlled by AnimationClock, and those deriving from TimelineGroup are controlled by ClockGroup.
For every active timeline, there is a clock in the Time Manager, and if the timeline is complex, there is the same hierarchy of clocks running parallel to the timeline (for example, if a Storyboard has 2 DoubleAnimation children, there is a total of 3 clocks, one ClockGroup for the Storyboard and two AnimationClocks for the DoubleAnimations that are children of the Storyboard). This hierarchy of running clocks allows a well defined order that allow controlling things like the speed ratio, or stop all the clock hierarchy.
Further information can be consulted in the WPF official documentation
Properties
| Name | Description |
|---|---|
| ◆ CurrentIteration | Get the current iteration of this clock within its current active period, or -1 if this clock is stopped |
| ◆ CurrentProgress | Gets the current progress of Clock within its current iteration. This is a value between 0.0 and 1.0 |
| ◆ CurrentTime | Gets this clock's current time within its current iteration |
| ◆ Parent | Gets or sets the clock that is the parent of this clock |
| ◆ Timeline | Gets the Timeline from which this Clock was created |
◆ Dependency Property ◆ Reflection Property
Attached Properties
Clock has no attached properties
Methods
| Name | Description |
|---|---|
| ◆ GetCurrentState() | Gets a value indicating whether the clock is currently Active, Filling or Stopped |
| ◆ HasControllableRoot() | Gets a value that indicates whether this Clock is part of a controllable clock tree |
Events
| Name | Description |
|---|---|
| ◆ Completed | Occurs when this clock has completely finished playing |
◆ Routed Event ◆ Non-routed Event ◆ Delegate Event
📍 On this page