Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

TranslationAnimation class

Applies to Windows only

Provides methods that enable you to retrieve the parameters for a translation (move to a new location) animation.

Syntax


/* For information about creating or accessing this object, see Remarks. */

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Version(0x06020000)]

Members

The TranslationAnimation class has these types of members:

Methods

The TranslationAnimation class inherits methods from the Object class (C#/VB/C++).

Properties

The TranslationAnimation class has these properties.

PropertyAccess typeDescription

Control1

Read-onlyGets the location of the first control point for the cubic Bézier curve that describes how the translation should animate over time.

Control2

Read-onlyGets the location of the second control point for the cubic Bézier curve that describes how the translation should animate over time.

Delay

Read-onlyGets the amount of time between when the translation animation is instructed to begin and when that animation actually begins to draw.

Duration

Read-onlyGets the amount of time over which the translation animation should be performed. This does not include the delay.

Type

Read-onlyGets the type of animation represented by this object.

 

Remarks

To execute a translation animation, shift the item's position from its current location to its final location (the location of the object after the change in layout) according to the timing information provided through the methods of this interface.

Examples

To obtain an instance of the TranslationAnimation class, you first obtain the collection of animations in the animation description, and then walk that array of animations to find any that are of type translation. The following examples shows this process. The effect and target parameters are assumed to have been previously assigned.



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

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);
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;
    }
}

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

None supported

Namespace

Windows.UI.Core.AnimationMetrics
Windows::UI::Core::AnimationMetrics [C++]

Metadata

Windows.winmd

See also

Animation metrics sample
AnimationDescription

 

 

Show:
© 2014 Microsoft