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
Public Sub BeginStoryboard (storyboard As Storyboard)

参数

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
Public Sub BeginStoryboard (storyboard As Storyboard, handoffBehavior As HandoffBehavior)

参数

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

Storyboard使用将、或应用 AnimationTimeline AnimationClock 到属性时 Compose HandoffBehaviorClock 以前与该属性关联的任何对象将继续使用系统资源; 计时系统不会自动删除时钟。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
Public Sub BeginStoryboard (storyboard As Storyboard, handoffBehavior As HandoffBehavior, isControllable As Boolean)

参数

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

Storyboard使用将、或应用 AnimationTimeline AnimationClock 到属性时 Compose HandoffBehaviorClock 以前与该属性关联的任何对象将继续使用系统资源; 计时系统不会自动删除这些时钟。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.

适用于