Teilen über


Animatable.ApplyAnimationClock Methode

Definition

Animiert die angegebene DependencyProperty mithilfe der angegebenen AnimationClock.

Überlädt

ApplyAnimationClock(DependencyProperty, AnimationClock)

Wendet eine AnimationClock auf die angegebene DependencyPropertyan. Wenn die Eigenschaft bereits animiert ist, wird das SnapshotAndReplace Handoffverhalten verwendet.

ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

Wendet eine AnimationClock auf die angegebene DependencyPropertyan. Wenn die Eigenschaft bereits animiert ist, wird die angegebene HandoffBehavior verwendet.

ApplyAnimationClock(DependencyProperty, AnimationClock)

Wendet eine AnimationClock auf die angegebene DependencyPropertyan. Wenn die Eigenschaft bereits animiert ist, wird das SnapshotAndReplace Handoffverhalten verwendet.

public:
 virtual void ApplyAnimationClock(System::Windows::DependencyProperty ^ dp, System::Windows::Media::Animation::AnimationClock ^ clock);
public void ApplyAnimationClock (System.Windows.DependencyProperty dp, System.Windows.Media.Animation.AnimationClock clock);
abstract member ApplyAnimationClock : System.Windows.DependencyProperty * System.Windows.Media.Animation.AnimationClock -> unit
override this.ApplyAnimationClock : System.Windows.DependencyProperty * System.Windows.Media.Animation.AnimationClock -> unit
Public Sub ApplyAnimationClock (dp As DependencyProperty, clock As AnimationClock)

Parameter

dp
DependencyProperty

Die zu animierende Eigenschaft.

clock
AnimationClock

Die Uhr, mit der die angegebene Eigenschaft animiert werden soll. Wenn clocknullist, werden alle Animationen aus der angegebenen Eigenschaft entfernt (aber nicht angehalten).

Implementiert

Hinweise

Beachten Sie, dass die Verwendung dieser Methode zum Entfernen von Uhren aus einer Eigenschaft diese Uhren nicht stoppt.

Gilt für:

ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

Wendet eine AnimationClock auf die angegebene DependencyPropertyan. Wenn die Eigenschaft bereits animiert ist, wird die angegebene HandoffBehavior verwendet.

public:
 virtual void ApplyAnimationClock(System::Windows::DependencyProperty ^ dp, System::Windows::Media::Animation::AnimationClock ^ clock, System::Windows::Media::Animation::HandoffBehavior handoffBehavior);
public void ApplyAnimationClock (System.Windows.DependencyProperty dp, System.Windows.Media.Animation.AnimationClock clock, System.Windows.Media.Animation.HandoffBehavior handoffBehavior);
abstract member ApplyAnimationClock : System.Windows.DependencyProperty * System.Windows.Media.Animation.AnimationClock * System.Windows.Media.Animation.HandoffBehavior -> unit
override this.ApplyAnimationClock : System.Windows.DependencyProperty * System.Windows.Media.Animation.AnimationClock * System.Windows.Media.Animation.HandoffBehavior -> unit
Public Sub ApplyAnimationClock (dp As DependencyProperty, clock As AnimationClock, handoffBehavior As HandoffBehavior)

Parameter

dp
DependencyProperty

Die zu animierende Eigenschaft.

clock
AnimationClock

Die Uhr, mit der die angegebene Eigenschaft animiert werden soll. Wenn handoffBehaviorSnapshotAndReplace ist und clocknullist, werden alle Animationen aus der angegebenen Eigenschaft entfernt (aber nicht beendet). Wenn handoffBehaviorCompose ist und die Uhr nullist, hat diese Methode keine Auswirkung.

handoffBehavior
HandoffBehavior

Ein Wert, der angibt, wie die neue Animation mit allen aktuellen Animationen interagieren soll, die sich bereits auf den Eigenschaftswert auswirken.

Implementiert

Beispiele

Das folgende Beispiel zeigt, wie Sie Animationsuhren mit unterschiedlichen HandoffBehavior Einstellungen anwenden.

Hinweise

Beachten Sie, dass die Verwendung dieser Methode zum Entfernen von Uhren aus einer Eigenschaft diese Uhren nicht stoppt.

Verwenden des VerfassenhandoffBehavior

Wenn Sie eine Storyboard, AnimationTimelineoder AnimationClock auf eine Eigenschaft mit dem ComposeHandoffBehavioranwenden, verbrauchen alle zuvor dieser Eigenschaft zugeordneten Clock Objekte weiterhin Systemressourcen; Das Timing-System entfernt diese Uhren nicht automatisch.

Um Leistungsprobleme zu vermeiden, wenn Sie eine große Anzahl von Uhren mit Composeanwenden, sollten Sie das Verfassen von Uhren nach Abschluss der animierten Eigenschaft entfernen. Es gibt mehrere Möglichkeiten, eine Uhr zu entfernen.

Dies ist in erster Linie ein Problem bei Animationen für Objekte, die eine lange Lebensdauer aufweisen. Wenn ein Objekt garbage collection wird, werden die Uhren ebenfalls getrennt und garbage collection.

Weitere Informationen zu Uhrenobjekten finden Sie unter Animation and Timing System Overview.

Gilt für: