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:
プロパティからすべてのクロックを削除するには、アニメーション化されたオブジェクトの ApplyAnimationClock(DependencyProperty, AnimationClock) または BeginAnimation(DependencyProperty, AnimationTimeline) メソッドを使用します。To remove all clocks from a property, use the ApplyAnimationClock(DependencyProperty, AnimationClock) or BeginAnimation(DependencyProperty, AnimationTimeline) method of the animated object. アニメーション化するプロパティを 1 番目のパラメーターとして指定し、
null
を 2 番目として指定します。Specify the property being animated as the first parameter, andnull
as the second. これにより、すべてのアニメーション クロックがプロパティから削除されます。This will remove all animation clocks from the property.特定の AnimationClock をクロックの一覧から削除するには、AnimationClock の Controller プロパティを使用して ClockControllerを取得し、次に Remove の ClockController メソッドを呼び出します。To remove a specific AnimationClock from a list of clocks, use the Controller property of the AnimationClock to retrieve a ClockController, then call the Remove method of the ClockController. これは通常、クロックの Completed イベント ハンドラーで実行されます。This is typically done in the Completed event handler for a clock. によって制御できるのはルートクロックのみであることに注意 ClockController Controller してください。子クロックのプロパティはを返し
null
ます。Note that only root clocks can be controlled by a ClockController; the Controller property of a child clock returnsnull
. また、 Completed クロックの有効期間が無期限の場合にイベントが発生しないことにも注意してください。Note also that the Completed event will not be raised if the effective duration of the clock is forever. その場合、ユーザーはを呼び出すタイミングを決定する必要があり Remove ます。In that case, the user must determine when to call Remove.
これは主に、有効期間が長いオブジェクトでのアニメーションの問題です。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.