Animatable.ApplyAnimationClock Méthode

Définition

Anime la propriété DependencyProperty spécifiée à l'aide de l'horloge AnimationClock spécifiée.

Surcharges

ApplyAnimationClock(DependencyProperty, AnimationClock)

Applique AnimationClock au DependencyProperty spécifié. Si la propriété est déjà animée, le comportement de transfert SnapshotAndReplace est utilisé.

ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

Applique AnimationClock au DependencyProperty spécifié. Si la propriété spécifiée est déjà animée, le comportement HandoffBehavior spécifié est utilisé.

ApplyAnimationClock(DependencyProperty, AnimationClock)

Applique AnimationClock au DependencyProperty spécifié. Si la propriété est déjà animée, le comportement de transfert SnapshotAndReplace est utilisé.

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)

Paramètres

dp
DependencyProperty

Propriété à animer.

clock
AnimationClock

Horloge avec laquelle animer la propriété spécifiée. Si clock a la valeur null, toutes les animations sont supprimées de la propriété spécifiée (mais pas arrêtées).

Implémente

Remarques

Notez que l’utilisation de cette méthode pour supprimer des horloges d’une propriété n’arrête pas ces horloges.

S’applique à

ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

Applique AnimationClock au DependencyProperty spécifié. Si la propriété spécifiée est déjà animée, le comportement HandoffBehavior spécifié est utilisé.

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)

Paramètres

dp
DependencyProperty

Propriété à animer.

clock
AnimationClock

Horloge avec laquelle animer la propriété spécifiée. Si le comportement handoffBehavior correspond à SnapshotAndReplace si clock a la valeur null, toutes les animations seront supprimées de la propriété spécifiée (mais non arrêtées). Si le comportement handoffBehavior est Compose et si l'horloge a la valeur null, cette méthode est sans effet.

handoffBehavior
HandoffBehavior

Valeur qui spécifie comment la nouvelle animation doit interagir avec les animations en cours, affectant déjà la valeur de propriété.

Implémente

Exemples

L’exemple suivant montre comment appliquer des horloges d’animation à l’aide de paramètres différents HandoffBehavior .

Remarques

Notez que l’utilisation de cette méthode pour supprimer des horloges d’une propriété n’arrête pas ces horloges.

Utilisation de Compose HandoffBehavior

Lorsque vous appliquez un Storyboard, AnimationTimelineou AnimationClock à une propriété à l’aide de ComposeHandoffBehavior, les Clock objets précédemment associés à cette propriété continuent à consommer des ressources système ; le système de minutage ne supprime pas automatiquement ces horloges.

Pour éviter les problèmes de performances lorsque vous appliquez un grand nombre d’horloges à l’aide Composede , vous devez supprimer les horloges de composition de la propriété animée une fois qu’elles sont terminées. Il existe plusieurs manières de supprimer une horloge.

Il s’agit principalement d’un problème pour les animations sur des objets qui ont une durée de vie longue. Lorsqu’un objet est récupéré par le garbage collector, ses horloges sont également déconnectées et récupérées.

Pour plus d’informations sur les objets d’horloge, consultez Vue d’ensemble du système d’animation et de minutage.

S’applique à