AnimationDescription AnimationDescription AnimationDescription AnimationDescription Class

Exposes a collection of individual animation effects that are performed on a specific target to make up a complete Windows opacity, scaling, or translation animation.

Syntax

Declaration

public sealed class AnimationDescriptionpublic sealed class AnimationDescriptionPublic NotInheritable Class AnimationDescription

Remarks

Examples

This example shows the creation of an AnimationDescription object and its use. The effect and target parameters are assumed to have been previously assigned.


var animationDescription = new Windows.UI.Core.AnimationMetrics.AnimationDescription(effect, target);

var StaggerDelay = animationDescription.staggerDelay;
var StaggerDelayFactor = animationDescription.staggerDelayFactor;
var DelayLimit = animationDescription.delayLimit;
var ZOrder = animationDescription.zorder;

var animations = animationDescription.animations;
for (var i = 0; i < animations.size; i++) {
    var animation = animations[i];

    switch (animation.type) {
        case animationMetrics.PropertyAnimationType.scale:
            // Retrieve scale animation metrics
            break;
        case animationMetrics.PropertyAnimationType.translation:
            // Retrieve translation animation metrics
            break;
        case animationMetrics.PropertyAnimationType.opacity:

            // Retrieve scale animation metrics
            break;
    }
}

The following example shows the C# version of the same code.


using Windows.UI.Core.AnimationMetrics;

AnimationDescription animationDescription = new AnimationDescription(effect, target);

TimeSpan sd = animationDescription.StaggerDelay;
float tsf = animationDescription.StaggerDelayFactor;
TimeSpan dl = animationDescription.DelayLimit;
int zo = animationDescription.ZOrder;

foreach (var animation in animationDescription.Animations)
{
    switch (animation.Type)
    {
        case PropertyAnimationType.Scale:
            {
                ScaleAnimation scale = animation as ScaleAnimation;
                // Retrieve scale animation metrics.
            }
            break;
        case PropertyAnimationType.Translation:
            {
                TranslationAnimation scale = animation as TranslationAnimation;
                // Retrieve translation animation metrics.
            }
            break;
        case PropertyAnimationType.Opacity:
            {
                OpacityAnimation opacity = animation as OpacityAnimation;
                // Retrieve opacity animation metrics.
            }
            break;
    }

    TimeSpan delay = animation.Delay;
    TimeSpan duration = animation.Duration;
    Point c1 = animation.Control1;
    Point c2 = animation.Control2;
}

The following example shows the C++ version of the same code.


using namespace Windows::UI::Core::AnimationMetrics;

Constructors summary

Creates an AnimationDescription object with a specific animation and target.

Properties summary

Gets the collection of animations that are associated with the AnimationDescription object.

Gets the maximum cumulative delay time for the animation to be applied to the collection of objects in a target.

Gets the amount of time between the application of the animation effect to each object in a target that contains multiple objects. The StaggerDelay, together with the StaggerDelayFactor and DelayLimit, is one of the three elements used to control the relative timing of the animation effects.

Gets a multiplier that is applied to each occurrence of the stagger delay, increasing or decreasing the previous delay instance by that amount.

Gets the z-order position of an AnimationDescription object relative to other AnimationDescription objects in the same animation effect. AnimationDescription objects with a higher z-order cover transitions with a lower z-order.

Constructors

  • AnimationDescription(Windows.UI.Core.AnimationMetrics.AnimationEffect,Windows.UI.Core.AnimationMetrics.AnimationEffectTarget)
    AnimationDescription(Windows.UI.Core.AnimationMetrics.AnimationEffect,Windows.UI.Core.AnimationMetrics.AnimationEffectTarget)
    AnimationDescription(Windows.UI.Core.AnimationMetrics.AnimationEffect,Windows.UI.Core.AnimationMetrics.AnimationEffectTarget)
    AnimationDescription(Windows.UI.Core.AnimationMetrics.AnimationEffect,Windows.UI.Core.AnimationMetrics.AnimationEffectTarget)

    Creates an AnimationDescription object with a specific animation and target.

    public AnimationDescription(Windows.UI.Core.AnimationMetrics.AnimationEffect,Windows.UI.Core.AnimationMetrics.AnimationEffectTarget)public AnimationDescription(Windows.UI.Core.AnimationMetrics.AnimationEffect,Windows.UI.Core.AnimationMetrics.AnimationEffectTarget)Public Function AnimationDescription(Windows.UI.Core.AnimationMetrics.AnimationEffect,Windows.UI.Core.AnimationMetrics.AnimationEffectTarget) As

    Parameters

    Remarks

    It is important to note that not all targets are valid for all animation effects. If an effect does not support the specified target, the method will fail.

    The properties of an AnimationDescription object are captured at the time this method is called. If the user changes the animation settings, the originally captured values will continue to be returned by any AnimationDescription objects created before the change. To ensure that the properties you retrieve through methods of this class match the currently active settings, call this method to construct the object immediately before use.

    Because all properties of the AnimationDescription object are captured at the time of construction, the object itself is immutable and can be marshaled freely.

Properties

  • Animations
    Animations
    Animations
    Animations

    Gets the collection of animations that are associated with the AnimationDescription object.

    public IVectorView<IPropertyAnimation> Animations { get; }public IVectorView<IPropertyAnimation> Animations { get; }Public ReadOnly Property Animations As IVectorView<IPropertyAnimation>

    Property Value

    Remarks

    The returned animations should be applied to the object in the order they appear in the collection array. If two or more animations apply to an object, they will appear in the array in this order:

    1. Scale
    2. Translate
    3. Opacity If the animations are being applied to more than one object, then the stagger-related properties (StaggerDelay and StaggerDelayFactor ) describe the relative timing among the objects.
  • DelayLimit
    DelayLimit
    DelayLimit
    DelayLimit

    Gets the maximum cumulative delay time for the animation to be applied to the collection of objects in a target.

    public TimeSpan DelayLimit { get; }public TimeSpan DelayLimit { get; }Public ReadOnly Property DelayLimit As TimeSpan

    Property Value

    Remarks

    If a staggered set of animations is being applied to a set of objects, and the relative timing of the animations results in an animation that is set to occur after the DelayLimit time, the animation occurs at the DelayLimit time instead. For instance, if an object was set to animate at time t=231 ms when the DelayLimit was set to 200 ms, that animation would occur at 200 ms.

  • StaggerDelay
    StaggerDelay
    StaggerDelay
    StaggerDelay

    Gets the amount of time between the application of the animation effect to each object in a target that contains multiple objects. The StaggerDelay, together with the StaggerDelayFactor and DelayLimit, is one of the three elements used to control the relative timing of the animation effects.

    public TimeSpan StaggerDelay { get; }public TimeSpan StaggerDelay { get; }Public ReadOnly Property StaggerDelay As TimeSpan

    Property Value

    Remarks

    Consider a target that consists of four objects— labeled A, B, C, and D— with a StaggerDelay of 100 ms. Object A animates at time t=0, object B at time t=100 ms, object C at time t=200 ms, and object D at time t=300 ms.

    However, the StaggerDelay time between each object's animation can be changed by the values of the StaggerDelayFactor and DelayLimit. See those topics for a discussion of their effect on the relative animation timing.

    Note that an animation can have its own inherent Delay in addition to its StaggerDelay.

  • StaggerDelayFactor
    StaggerDelayFactor
    StaggerDelayFactor
    StaggerDelayFactor

    Gets a multiplier that is applied to each occurrence of the stagger delay, increasing or decreasing the previous delay instance by that amount.

    public float StaggerDelayFactor { get; }public float StaggerDelayFactor { get; }Public ReadOnly Property StaggerDelayFactor As float

    Property Value

    • float
      float
      float
      float

      The factor to apply to the stagger delay.

    Remarks

    The StaggerDelayFactor is a multiplier applied to the last value of the StaggerDelay. Consider a target that consists of four objects— labeled A, B, C, and D— with an initial StaggerDelay of 100 ms and a StaggerDelayFactor of 0.75. This means that the delay between subsequent objects is reduced to 75% of the previous delay. Under these conditions, object A animates at time t=0 and object B at time t=100 ms. The StaggerDelayFactor then reduces the delay for object C to 100 ms * 0.75 = 75 ms, so object C animates at time t=175 ms. The StaggerDelayFactor then reduces the delay for object D to 75 ms * 0.75 = 56 ms, so object D animates at time t=231 ms.

    However, there is one more element that can affect these values— the DelayLimit. See that topic for a discussion of its effect on the relative animation timing.

  • ZOrder
    ZOrder
    ZOrder
    ZOrder

    Gets the z-order position of an AnimationDescription object relative to other AnimationDescription objects in the same animation effect. AnimationDescription objects with a higher z-order cover transitions with a lower z-order.

    public int ZOrder { get; }public int ZOrder { get; }Public ReadOnly Property ZOrder As int

    Property Value

    • int
      int
      int
      int

      The z-order value.

    Remarks

    The z-order value is used only for arranging AnimationDescription objects within the same overall animation. It has no effect on AnimationDescription objects from different transitions.

Device family

Windows Desktop Extension SDK (introduced v10.0.10240.0)

API contract

Windows.UI.Core.AnimationMetrics.AnimationMetricsContract (introduced v1)

Attributes

Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute

Details

Assembly

Windows.UI.Core.AnimationMetrics.dll