HandoffBehavior 枚举


指定新动画如何与已经应用于属性的任何现有动画进行交互。Specifies how new animations interact with any existing ones that are already applied to a property.

public enum class HandoffBehavior
public enum HandoffBehavior
type HandoffBehavior = 
Public Enum HandoffBehavior


Compose 1

通过将新动画追加到组合链的末尾来组合新动画和现有动画。New animations are combined with existing animations by appending the new animations to the end of the composition chain.

SnapshotAndReplace 0

新动画替换它们所应用到的属性上的任何现有动画。New animations replace any existing animations on the properties to which they are applied.


Storyboard AnimationTimeline 使用撰写将、或应用 AnimationClock 到属性时, Clock 以前与该属性关联的任何对象将继续使用系统资源; 计时系统不会自动删除时钟。When you apply a Storyboard, AnimationTimeline, or AnimationClock to a property by using Compose, any Clock objects previously associated with that property continue to consume system resources; the timing system will not remove the clocks automatically.

为了避免在使用撰写应用大量时钟时出现性能问题,应在完成后从动画属性中删除组合时钟。To avoid performance issues when you apply a large number of clocks using Compose, you should remove composing clocks from the animated property after they complete. 有几种方法可以删除时钟:There are several ways to remove a clock:

此动画问题主要出现在生存期较长的对象上。This is primarily an issue for animations on objects that have a long lifetime. 当对某个对象进行垃圾回收时,它的时钟也会断开连接并进行垃圾回收。When an object is garbage collected, its clocks will also be disconnected and garbage collected.

有关时钟对象的详细信息,请参阅动画和计时系统概述For more information about clock objects, see Animation and Timing System Overview.