AnimationDescription-Klasse

AnimationDescription Class

Stellt ein Sammlung individueller Animationseffekte bereit, die auf einem bestimmten Ziel ausgeführt werden und eine vollständige Windows-Animation mit Opazität, Skalierung und Verschiebung ergeben.

Syntax


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

Attribute

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

Member

AnimationDescriptionKlasse hat diese Membertypen:

Konstruktoren

AnimationDescriptionKlasse hat diese Konstruktoren.

KonstruktorBeschreibung
AnimationDescription Creates an AnimationDescription object with a specific animation and target.

 

Methoden

The AnimationDescription Klasse erbt Methoden von Object Klasse (C#/VB/C++).

Eigenschaften

Der AnimationDescriptionKlasse hat diese Eigenschaften.

EigenschaftZugriffstypBeschreibung

Animations

SchreibgeschütztGets the collection of animations that are associated with the AnimationDescription object.

DelayLimit

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

StaggerDelay

SchreibgeschütztGets 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

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

ZOrder

SchreibgeschütztGets the z-order position of an AnimationDescription object relative to other AnimationDescription objects in the same animation effect.

 

Beispiele

In diesem Beispiel wird die Erstellung eines AnimationDescription-Objekts und dessen Verwendung gezeigt. Es wird davon ausgegangen, dass die effect- und target-Parameter bereits zuvor zugewiesen wurden.



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

Das folgende Beispiel zeigt die C#-Version desselben Codes.



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

Das folgende Beispiel zeigt die C++-Version desselben Codes.



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



                    

Anforderungen

Mindestens unterstützter Client

Windows 8 [Windows Store-Apps, Desktop-Apps]

Mindestens unterstützter Server

Windows Server 2012 [Windows Store-Apps, Desktop-Apps]

Namespace

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

Metadaten

Windows.winmd

Siehe auch

Animationsmetrikbeispiel
OpacityAnimation
ScaleAnimation
TranslationAnimation

 

 

Anzeigen:
© 2017 Microsoft