AnimationDescription 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
公开对特定目标执行的单个动画效果的集合,以构成完整的 Windows 不透明度、缩放或转换动画。
public ref class AnimationDescription sealed
/// [Windows.Foundation.Metadata.Activatable(Windows.UI.Core.AnimationMetrics.IAnimationDescriptionFactory, 65536, Windows.UI.Core.AnimationMetrics.AnimationMetricsContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.UI.Core.AnimationMetrics.AnimationMetricsContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class AnimationDescription final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.UI.Core.AnimationMetrics.AnimationMetricsContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Activatable(Windows.UI.Core.AnimationMetrics.IAnimationDescriptionFactory, 65536, "Windows.UI.Core.AnimationMetrics.AnimationMetricsContract")]
class AnimationDescription final
[Windows.Foundation.Metadata.Activatable(typeof(Windows.UI.Core.AnimationMetrics.IAnimationDescriptionFactory), 65536, typeof(Windows.UI.Core.AnimationMetrics.AnimationMetricsContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.UI.Core.AnimationMetrics.AnimationMetricsContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class AnimationDescription
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.UI.Core.AnimationMetrics.AnimationMetricsContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.UI.Core.AnimationMetrics.IAnimationDescriptionFactory), 65536, "Windows.UI.Core.AnimationMetrics.AnimationMetricsContract")]
public sealed class AnimationDescription
function AnimationDescription(effect, target)
Public NotInheritable Class AnimationDescription
- 继承
- 属性
Windows 要求
设备系列 |
Windows Desktop Extension SDK (在 10.0.10240.0 中引入)
|
API contract |
Windows.UI.Core.AnimationMetrics.AnimationMetricsContract (在 v1.0 中引入)
|
示例
此示例演示如何创建 AnimationDescription 对象及其用法。 假定 先前 已分配效果参数和 目标 参数。
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;
}
构造函数
AnimationDescription(AnimationEffect, AnimationEffectTarget) |
创建具有特定动画和目标的 AnimationDescription 对象。 |
属性
Animations |
获取与 AnimationDescription 对象关联的动画的集合。 |
DelayLimit |
获取要应用于目标中对象的集合的动画的最大累积延迟时间。 |
StaggerDelay |
获取将动画效果应用到包含多个 对象的目标中的每个 对象之间的时间。 StaggerDelay 以及 StaggerDelayFactor 和 DelayLimit 是用于控制动画效果相对计时的三个元素之一。 |
StaggerDelayFactor |
获取一个乘数,该乘数应用于交错延迟的每个匹配项,按该量增加或减少上一个延迟实例。 |
ZOrder |
获取相对于同一动画效果中其他 AnimationDescription 对象的 AnimationDescription 对象的 z 顺序位置。 具有较高 z 顺序封面的 AnimationDescription 对象以较低的 z 顺序转换。 |