🎬 Animation
The animation system allows developers to dynamically change the values of dependency properties over time. Animations can be instantiated seamlessly from either a XAML file or directly from code
Core Concepts
Animations can only be applied to dependency properties within dependency objects. This specific design ensures that an animated value can be stored and rendered without permanently overwriting or losing the property's original base value
Example: If a float property is initially set to a value of 10, an animation might temporarily modify this value to create a visual transition when a user clicks a button. Throughout this process, the underlying original value of 10 is preserved and can be retrieved at any moment.
System Architecture
The animation architecture relies on three primary objects to function:
Timeline
The Timeline is the object that dictates exactly how a value transitions over time.
- A single timeline can be applied to multiple properties simultaneously.
- Timelines vary in complexity, ranging from simple linear interpolations to advanced compositions that utilize non-linear functions, such as splines.
- The timeline hierarchy is the foundational concept of the animation package. For a more detailed explanation, please refer to the Timeline documentation.
Clock
Every active timeline is associated with at least one clock.
- The clock is responsible for computing the current time, querying the timeline for the updated value, and assigning that resulting value to the target property
- Like timelines, a single clock can be applied to many properties across different objects.
- For deeper technical insights, see the Clocks documentation
Time Manager
- Programmers generally do not need to access the Time Manager directly.
- Clock management should instead be handled using the dedicated methods provided within the timeline classes themselves.
📍 On this page