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.