FrameworkContentElement.BeginStoryboard 方法

定義

開始提供之腳本中包含的動作順序。Begins the sequence of actions that are contained in the provided storyboard.

多載

BeginStoryboard(Storyboard)

開始提供之腳本中包含的動作順序。Begins the sequence of actions that are contained in the provided storyboard.

BeginStoryboard(Storyboard, HandoffBehavior)

使用若屬性已經顯示動畫時應發生之情形的指定選項,開始提供之腳本中包含的動作順序。Begins the sequence of actions that are contained in the provided storyboard, with options specified for what should occur if the property is already animated.

BeginStoryboard(Storyboard, HandoffBehavior, Boolean)

使用控制啟動後之動畫的指定狀態,開始提供之腳本中包含的動作順序。Begins the sequence of actions that are contained in the provided storyboard, with specified state for control of the animation after it is started.

BeginStoryboard(Storyboard)

開始提供之腳本中包含的動作順序。Begins the sequence of actions that are contained in the provided storyboard.

public:
 void BeginStoryboard(System::Windows::Media::Animation::Storyboard ^ storyboard);
public void BeginStoryboard (System.Windows.Media.Animation.Storyboard storyboard);
member this.BeginStoryboard : System.Windows.Media.Animation.Storyboard -> unit

參數

storyboard
Storyboard

要開始的腳本。The storyboard to begin.

備註

針對不使用 isControllable、參數或 false指定該參數的簽章,與動畫相關聯的時間軸時鐘會在達到「填滿」期間時立即移除。For the signatures that do not use the isControllable, parameter, or when that parameter is specified false, the timeline clocks associated with the animation are removed as soon as it reaches the "Fill" period. 因此,動畫在執行一次之後就無法重新開機。Therefore the animation cannot be restarted after being run once. 請注意,控制動畫也需要在程式碼中將分鏡腳本命名或當做實例來存取。Note that controlling an animation also requires that the storyboard be named or accessible as an instance in code.

BeginStoryboard(Storyboard, HandoffBehavior)

使用若屬性已經顯示動畫時應發生之情形的指定選項,開始提供之腳本中包含的動作順序。Begins the sequence of actions that are contained in the provided storyboard, with options specified for what should occur if the property is already animated.

public:
 void BeginStoryboard(System::Windows::Media::Animation::Storyboard ^ storyboard, System::Windows::Media::Animation::HandoffBehavior handoffBehavior);
public void BeginStoryboard (System.Windows.Media.Animation.Storyboard storyboard, System.Windows.Media.Animation.HandoffBehavior handoffBehavior);
member this.BeginStoryboard : System.Windows.Media.Animation.Storyboard * System.Windows.Media.Animation.HandoffBehavior -> unit

參數

storyboard
Storyboard

要開始的腳本。The storyboard to begin.

handoffBehavior
HandoffBehavior

列舉型別的值,其描述若腳本中描述的屬性已顯示動畫時,所要使用的行為。A value of the enumeration that describes behavior to use if a property described in the storyboard is already animated.

備註

針對不使用 isControllable、參數或 false指定該參數的簽章,與動畫相關聯的時間軸時鐘會在達到「填滿」期間時立即移除。For the signatures that do not use the isControllable, parameter, or when that parameter is specified false, the timeline clocks associated with the animation are removed as soon as it reaches the "Fill" period. 因此,動畫在執行一次之後就無法重新開機。Therefore the animation cannot be restarted after being run once. 請注意,控制動畫也需要在程式碼中將分鏡腳本命名或當做實例來存取。Note that controlling an animation also requires that the storyboard be named or accessible as an instance in code.

使用撰寫 HandoffBehaviorUsing the Compose HandoffBehavior

當您使用 Compose HandoffBehaviorStoryboardAnimationTimelineAnimationClock 套用至屬性時,先前與該屬性相關聯的任何 Clock 物件都會繼續使用系統資源;計時系統不會自動移除時鐘。When you apply a Storyboard, AnimationTimeline, or AnimationClock to a property by using the Compose HandoffBehavior, any Clock objects previously associated with that property continue to consume system resources; the timing system does not remove the clocks automatically.

當您使用 Compose來套用大量時鐘時,若要避免效能問題,您應該在完成後,從動畫屬性中移除撰寫的時鐘。To avoid performance issues when you apply a large number of clocks by using Compose, you should remove composing clocks from the animated property after they complete. 有數種方式可以移除時鐘:There are several ways to remove a clock:

這主要是在存留期較長的物件才會發生的動畫問題。This is primarily an issue for animations on objects that have a long lifetime. 當物件進行垃圾收集時,其時鐘也會中斷連線並進行垃圾收集。When an object is garbage collected, its clocks are also disconnected and garbage collected.

如需時鐘物件的詳細資訊,請參閱動畫和計時系統總覽For more information about clock objects, see Animation and Timing System Overview.

BeginStoryboard(Storyboard, HandoffBehavior, Boolean)

使用控制啟動後之動畫的指定狀態,開始提供之腳本中包含的動作順序。Begins the sequence of actions that are contained in the provided storyboard, with specified state for control of the animation after it is started.

public:
 void BeginStoryboard(System::Windows::Media::Animation::Storyboard ^ storyboard, System::Windows::Media::Animation::HandoffBehavior handoffBehavior, bool isControllable);
public void BeginStoryboard (System.Windows.Media.Animation.Storyboard storyboard, System.Windows.Media.Animation.HandoffBehavior handoffBehavior, bool isControllable);
member this.BeginStoryboard : System.Windows.Media.Animation.Storyboard * System.Windows.Media.Animation.HandoffBehavior * bool -> unit

參數

storyboard
Storyboard

要開始的腳本。The storyboard to begin.

handoffBehavior
HandoffBehavior

列舉值,其描述若腳本中描述的屬性已顯示動畫時,所要使用的行為。A value of the enumeration that describes behavior to use if a property described in the storyboard is already animated.

isControllable
Boolean

宣告在動畫啟動後,是否可以控制 (暫停) 該動畫。Declares whether the animation is controllable (can be paused) after it is started.

備註

針對不使用 isControllable、參數或 false指定該參數的簽章,與動畫相關聯的時間軸時鐘會在達到「填滿」期間時立即移除。For the signatures that do not use the isControllable, parameter, or when that parameter is specified false, the timeline clocks associated with the animation are removed as soon as it reaches the "Fill" period. 因此,動畫在執行一次之後就無法重新開機。Therefore the animation cannot be restarted after being run once. 請注意,控制動畫也需要在程式碼中將分鏡腳本命名或當做實例來存取。Note that controlling an animation also requires that the storyboard be named or accessible as an instance in code.

使用撰寫 HandoffBehaviorUsing the Compose HandoffBehavior

當您使用 Compose HandoffBehaviorStoryboardAnimationTimelineAnimationClock 套用至屬性時,先前與該屬性相關聯的任何 Clock 物件都會繼續使用系統資源;計時系統不會自動移除這些時鐘。When you apply a Storyboard, AnimationTimeline, or AnimationClock to a property by using the Compose HandoffBehavior, any Clock objects previously associated with that property continue to consume system resources; the timing system does not remove these clocks automatically.

當您使用 Compose來套用大量時鐘時,若要避免效能問題,您應該在完成後,從動畫屬性中移除撰寫的時鐘。To avoid performance issues when you apply a large number of clocks by using Compose, you should remove composing clocks from the animated property after they complete. 有數種方式可以移除時鐘:There are several ways to remove a clock:

這主要是在存留期較長的物件才會發生的動畫問題。This is primarily an issue for animations on objects that have a long lifetime. 當物件進行垃圾收集時,其時鐘也會中斷連線並進行垃圾收集。When an object is garbage collected, its clocks are also disconnected and garbage collected.

如需時鐘物件的詳細資訊,請參閱動畫和計時系統總覽For more information about clock objects, see Animation and Timing System Overview.

適用於