Animatable.ApplyAnimationClock Methode

Definition

Animates the specified DependencyProperty using the specified AnimationClock.

Überlädt

Name Beschreibung
ApplyAnimationClock(DependencyProperty, AnimationClock)

Wendet eine AnimationClock auf die angegebene DependencyProperty. Wenn die Eigenschaft bereits animiert ist, wird das SnapshotAndReplace Übergabeverhalten verwendet.

ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

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

ApplyAnimationClock(DependencyProperty, AnimationClock)

Wendet eine AnimationClock auf die angegebene DependencyProperty. Wenn die Eigenschaft bereits animiert ist, wird das SnapshotAndReplace Übergabeverhalten 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 clock ja null, 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 DependencyProperty. Wenn die Eigenschaft bereits animiert ist, wird die angegebene HandoffBehavior Eigenschaft 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. handoffBehavior Ist SnapshotAndReplace dies der clocknull Grund, werden alle Animationen aus der angegebenen Eigenschaft entfernt (aber nicht angehalten). Wenn handoffBehavior dies der Fall ist Compose und die Uhr ist null, 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 Animationsuhren mit unterschiedlichen HandoffBehavior Einstellungen angewendet werden.

Hinweise

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

Verwenden des VerfassenhandoffBehavior

Wenn Sie ein Storyboard, AnimationTimeline oder AnimationClock auf eine Eigenschaft mithilfe von ComposeHandoffBehavior anwenden, werden alle Clock-Objekte, die zuvor dieser Eigenschaft zugeordnet waren, weiterhin Systemressourcen verbrauchen; Das Zeitsystem entfernt diese Uhren nicht automatisch.

Um Leistungsprobleme zu vermeiden, wenn Sie eine große Anzahl von Zeitgebern mit Compose verwenden, sollten Sie zusammengesetzte Zeitgeber aus der animierten Eigenschaft entfernen, nachdem diese abgeschlossen sind. 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 gesammelt wird, werden seine Uhren ebenfalls getrennt und gesammelt.

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

Gilt für: