OpacityAnimation class
Provides methods that enable you to retrieve the parameters of an opacity (fade in or fade out) animation.
Syntax
/* For information about creating or accessing this object, see Remarks. */
Attributes
- DualApiPartitionAttribute()
- MarshalingBehaviorAttribute(Agile)
- VersionAttribute(NTDDI_WIN8)
Members
The OpacityAnimation class has these types of members:
Methods
The OpacityAnimation class inherits methods from the Object class (C#/VB/C++).
Properties
The OpacityAnimation class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the location of the first control point for the cubic Bzier curve that describes how the opacity should animate over time. | |
| Read-only | Gets the location of the second control point for the cubic Bzier curve that describes how the opacity should animate over time. | |
| Read-only | Gets the amount of time between when the opacity animation is instructed to begin and when that animation actually begins to draw. | |
| Read-only | Gets the amount of time over which the opacity animation should be performed. This does not include the delay. | |
| Read-only | Gets the object's final opacity. | |
| Read-only | Gets the object's initial opacity. | |
| Read-only | Gets the type of animation represented by this object. |
Examples
To obtain an instance of the OpacityAnimation 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 opacity. The following example 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] |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 12/4/2012