AnimationDescription AnimationDescription AnimationDescription AnimationDescription AnimationDescription Class

Definition

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.

public : sealed class AnimationDescription : IAnimationDescription
struct winrt::Windows::UI::Core::AnimationMetrics::AnimationDescription : IAnimationDescription
public sealed class AnimationDescription : IAnimationDescription
Public NotInheritable Class AnimationDescription Implements IAnimationDescription
var animationDescription = new animationDescription(effect, target);
Attributes
Windows 10 requirements
Device family
Windows Desktop Extension SDK (introduced v10.0.10240.0)
API contract
Windows.UI.Core.AnimationMetrics.AnimationMetricsContract (introduced v1)

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

AnimationDescription(AnimationEffect, AnimationEffectTarget) AnimationDescription(AnimationEffect, AnimationEffectTarget) AnimationDescription(AnimationEffect, AnimationEffectTarget) AnimationDescription(AnimationEffect, AnimationEffectTarget) AnimationDescription(AnimationEffect, AnimationEffectTarget)

Creates an AnimationDescription object with a specific animation and target.

Properties

Animations Animations Animations Animations Animations

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

DelayLimit DelayLimit DelayLimit DelayLimit DelayLimit

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

StaggerDelay 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.

StaggerDelayFactor 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.

ZOrder 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.

See Also