ContentElement.ApplyAnimationClock 方法

定義

將動畫套用至這個項目上所指定的相依性屬性。Applies an animation to a specified dependency property on this element.

多載

ApplyAnimationClock(DependencyProperty, AnimationClock)

將動畫套用至這個項目上所指定的相依性屬性。Applies an animation to a specified dependency property on this element. 任何現有動畫都會停止並取代為新的動畫。Any existing animations are stopped and replaced with the new animation.

ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

將動畫套用至這個項目上所指定的相依性屬性,且可以指定此屬性已經有執行中的動畫時會發生哪種情況。Applies an animation to a specified dependency property on this element, with the ability to specify what happens if the property already has a running animation.

ApplyAnimationClock(DependencyProperty, AnimationClock)

將動畫套用至這個項目上所指定的相依性屬性。Applies an animation to a specified dependency property on this element. 任何現有動畫都會停止並取代為新的動畫。Any existing animations are stopped and replaced with the new animation.

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)

參數

dp
DependencyProperty

要繪製的屬性之識別項。The identifier for the property to animate.

clock
AnimationClock

控制並宣告動畫的動畫時鐘。The animation clock that controls and declares the animation.

實作

備註

若要從屬性中移除動畫,請將該屬性的識別碼指定為 dp,並將 clock 指定為 nullTo remove an animation from a property, specify the identifier for that property as dp and specify clock as null. 這會移除動畫,且動畫屬性會設定為其基底值。This removes the animation and the animated property is set to its base value. 不過,原先關聯的動畫時鐘不會停止。However, the originally associated animation clock is not stopped. 任何其他指派給該時鐘的動畫都會繼續執行。Any other animations assigned to that clock will continue to run.

ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

將動畫套用至這個項目上所指定的相依性屬性,且可以指定此屬性已經有執行中的動畫時會發生哪種情況。Applies an animation to a specified dependency property on this element, with the ability to specify what happens if the property already has a running animation.

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

參數

dp
DependencyProperty

要製作動畫的屬性。The property to animate.

clock
AnimationClock

控制並宣告動畫的動畫時鐘。The animation clock that controls and declares the animation.

handoffBehavior
HandoffBehavior

列舉值。A value of the enumeration. 預設值是 SnapshotAndReplace,將停止任何現有的動畫,並以新的動畫取代。The default is SnapshotAndReplace, which will stop any existing animation and replace with the new one.

實作

備註

若要從屬性中移除動畫,請將該屬性的識別碼指定為 dp,並將 clock 指定為 nullTo remove an animation from a property, specify the identifier for that property as dp and specify clock as null. 這會移除動畫,且動畫屬性會設定為其基底值。This removes the animation and the animated property is set to its base value. 不過,原先關聯的動畫時鐘不會停止。However, the originally associated animation clock is not stopped. 任何其他指派給該時鐘的動畫都會繼續執行。Any other animations assigned to that clock will continue to run.

適用於