Show / Hide Table of Contents

Class Storyboard

Controls animations with a timeline, and provides object and property targeting information for its child animations.

Inheritance
System.Object
DependencyObject
Timeline
Storyboard
Inherited Members
Timeline.Completed
Timeline.AutoReverseProperty
Timeline.AutoReverse
Timeline.BeginTimeProperty
Timeline.BeginTime
Timeline.DurationProperty
Timeline.Duration
Timeline.FillBehaviorProperty
Timeline.FillBehavior
Timeline.RepeatBehaviorProperty
Timeline.RepeatBehavior
Timeline.SpeedRatioProperty
Timeline.SpeedRatio
Timeline.GetNaturalDurationCore()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.INTERNAL_OnAttachedToVisualTree()
DependencyObject.INTERNAL_OnDetachedFromVisualTree()
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Media.Animation
Assembly: OpenSilver.dll
Syntax
public sealed class Storyboard : Timeline, IDependencyObject

Constructors

| Improve this Doc View Source

Storyboard()

Initializes a new instance of the Storyboard class.

Declaration
public Storyboard()

Fields

| Improve this Doc View Source

TargetNameProperty

Identifies the Storyboard.TargetName attached property.

Declaration
public static readonly DependencyProperty TargetNameProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

TargetProperty

Identifies the Storyboard.TargetName attached property.

Declaration
public static readonly DependencyProperty TargetProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

TargetPropertyProperty

Identifies the Storyboard.TargetProperty attached property.

Declaration
public static readonly DependencyProperty TargetPropertyProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

Children

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 Source

Begin()

Initiates the set of animations associated with the storyboard.

Declaration
public void Begin()
| Improve this Doc View Source

GetCurrentState()

Gets the clock state of the storyboard.

Declaration
public ClockState GetCurrentState()
Returns
Type Description
ClockState

One of the enumeration values: Active, Filling, or Stopped.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

Pause()

Pauses the animation clock associated with the storyboard.

Declaration
public void Pause()
| Improve this Doc View Source

Resume()

Resumes the animation clock, or run-time state, associated with the storyboard.

Declaration
public void Resume()
| Improve this Doc View Source

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"

| Improve this Doc View Source

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]"

  • or - "days"
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

SkipToFill()

Advances the current time of the storyboard's clock to the end of its active period.

Declaration
public void SkipToFill()
| Improve this Doc View Source

Stop()

Stops the storyboard.

Declaration
public void Stop()

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
  • Improve this Doc
  • View Source