Class Storyboard
Controls animations with a timeline, and provides object and property targeting information for its child animations.
Inherited Members
Namespace: System.Windows.Media.Animation
Assembly: OpenSilver.dll
Syntax
public sealed class Storyboard : Timeline, IDependencyObject
Constructors
| Improve this Doc View SourceStoryboard()
Initializes a new instance of the Storyboard class.
Declaration
public Storyboard()
Fields
| Improve this Doc View SourceTargetNameProperty
Identifies the Storyboard.TargetName attached property.
Declaration
public static readonly DependencyProperty TargetNameProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TargetProperty
Identifies the Storyboard.TargetName attached property.
Declaration
public static readonly DependencyProperty TargetProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TargetPropertyProperty
Identifies the Storyboard.TargetProperty attached property.
Declaration
public static readonly DependencyProperty TargetPropertyProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceChildren
Gets the collection of child Timeline objects.
Declaration
public TimelineCollection Children { get; }
Property Value
Type | Description |
---|---|
TimelineCollection | The collection of child Timeline objects. The default is an empty collection. |
Methods
| Improve this Doc View SourceBegin()
Initiates the set of animations associated with the storyboard.
Declaration
public void Begin()
GetCurrentState()
Gets the clock state of the storyboard.
Declaration
public ClockState GetCurrentState()
Returns
Type | Description |
---|---|
ClockState |
GetCurrentTime()
Gets the current time of the storyboard.
Declaration
public TimeSpan GetCurrentTime()
Returns
Type | Description |
---|---|
System.TimeSpan | The current time of the storyboard, or null if the storyboard's clock is Stopped. |
GetTarget(Timeline)
Gets the value of the Storyboard.Target attached property from a target element.
Declaration
public static DependencyObject GetTarget(Timeline element)
Parameters
Type | Name | Description |
---|---|---|
Timeline | element | The target element from which to get the value. |
Returns
Type | Description |
---|---|
DependencyObject | The Storyboard.Target value of the target element. |
GetTargetName(Timeline)
Gets the Storyboard.TargetName of the specified Timeline object.
Declaration
public static string GetTargetName(Timeline element)
Parameters
Type | Name | Description |
---|---|---|
Timeline | element | The Timeline object to get the target name from. |
Returns
Type | Description |
---|---|
System.String | The string name of the target object. |
GetTargetProperty(Timeline)
Gets the Storyboard.TargetProperty of the specified Timeline object.
Declaration
public static PropertyPath GetTargetProperty(Timeline element)
Parameters
Type | Name | Description |
---|---|---|
Timeline | element | The Timeline object to get the target property from. |
Returns
Type | Description |
---|---|
PropertyPath | The property path information for the animated property. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | element is null. |
Pause()
Pauses the animation clock associated with the storyboard.
Declaration
public void Pause()
Resume()
Resumes the animation clock, or run-time state, associated with the storyboard.
Declaration
public void Resume()
Seek(TimeSpan)
Moves the storyboard to the specified animation position. The storyboard performs the requested seek when the next clock tick occurs.
Declaration
public void Seek(TimeSpan offset)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | offset | A positive or negative time value that describes the amount by which the timeline should move forward or backward from the beginning of the animation. By using the System.TimeSpan Parse behavior, a System.TimeSpan can be specified as a string in the following format (in this syntax, the [] characters denote optional components of the string, but the quotes, colons, and periods are all a literal part of the syntax):"[days.]hours:minutes:seconds[.fractionalSeconds]"- or -"days" |
SeekAlignedToLastTick(TimeSpan)
Moves the storyboard to the specified animation position immediately(synchronously).
Declaration
public void SeekAlignedToLastTick(TimeSpan offset)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | offset | A positive or negative time value that describes the amount by which the timeline should move forward or backward from the beginning of the animation. By using the TimeSpan Parse behavior, a TimeSpan can be specified as a string in the following format (in this syntax, the [] characters denote optional components of the string, but the quotes, colons, and periods are all a literal part of the syntax): "[days.]hours:minutes:seconds[.fractionalSeconds]"
|
SetTarget(Timeline, DependencyObject)
Causes the specified Timeline to target the specified object.
Declaration
public static void SetTarget(Timeline element, DependencyObject target)
Parameters
Type | Name | Description |
---|---|---|
Timeline | element | The timeline that targets the specified dependency object. |
DependencyObject | target | The actual instance of the object to target. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | One or more of the parameters is null. |
SetTargetName(Timeline, String)
Causes the specified Timeline to target the object with the specified name.
Declaration
public static void SetTargetName(Timeline element, string name)
Parameters
Type | Name | Description |
---|---|---|
Timeline | element | The timeline that targets the specified dependency object. |
System.String | name | The name of the object to target. |
SetTargetProperty(Timeline, PropertyPath)
Causes the specified Timeline to target the specified dependency property.
Declaration
public static void SetTargetProperty(Timeline element, PropertyPath value)
Parameters
Type | Name | Description |
---|---|---|
Timeline | element | The timeline with which to associate the specified dependency property. |
PropertyPath | value | A path that describe the dependency property to be animated. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | One or more of the parameters is null. |
SkipToFill()
Advances the current time of the storyboard's clock to the end of its active period.
Declaration
public void SkipToFill()
Stop()
Stops the storyboard.
Declaration
public void Stop()