BeginStoryboard class

Applies to Windows and Windows Phone

A trigger action that begins a Storyboard. Not commonly used. See Remarks.

Inheritance

Object
  DependencyObject
    TriggerAction
      BeginStoryboard

Syntax


public sealed class BeginStoryboard : TriggerAction


<BeginStoryboard ...>
  singleStoryboard
</BeginStoryboard>

XAML Values

singleStoryboard

A single Storyboard object element.

Attributes

[ContentProperty("Name=Storyboard")]
[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The BeginStoryboard class has these types of members:

Constructors

The BeginStoryboard class has these constructors.

ConstructorDescription
BeginStoryboard Initializes a new instance of the BeginStoryboard class.

 

Methods

The BeginStoryboard class has these methods. It also inherits methods from the Object class.

MethodDescription
ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject)
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)

 

Properties

The BeginStoryboard class has these properties.

PropertyAccess typeDescription

Dispatcher

Read-onlyGets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject)

Storyboard

Read/writeGets or sets the Storyboard that this BeginStoryboard starts.

StoryboardProperty

Read-onlyIdentifies the BeginStoryboard.Storyboard dependency property.

 

Remarks

Triggers, EventTrigger, Actions and BeginStoryboard are not commonly used. These APIs mainly exist for compatibility in XAML originally used for Microsoft Silverlight. For most scenarios where event triggers were used previously, you should either use visual states, or start animations by writing a Loaded handler that looks up an animation in page-level resources and then calls Begin on the animation's main Storyboard. For more info, see Quickstart: Control templates or Storyboarded animations.

If you do choose to use Triggers, in Windows Runtime XAML, the default behavior for event triggers and the only event that can be used to invoke an EventTrigger is FrameworkElement.Loaded. Because that's both the default and the only enabled behavior, you don't set RoutedEvent, and just use the XAML <EventTrigger>. For more info, see Triggers.

Examples

This XAML example shows the basic structure for using FrameworkElement.Triggers with its default FrameworkElement.Loaded trigger behavior to run a storyboarded animation. This XAML shows the EventTrigger and BeginStoryboard container elements in proper relationship with each using their XAML content property syntax and unnecessary property element tags (such as BeginStoryboard.Storyboard) omitted.


<Canvas Width="200" Height="200" x:Name="animatedcanvas" Background="Red">
    <Canvas.Triggers>
        <EventTrigger>
            <BeginStoryboard>
                <Storyboard x:Name="ColorStoryboard">
                   <!-- Animate the background of the canvas to green over 4 seconds. -->
                    <ColorAnimation Storyboard.TargetName="animatedcanvas"
                      Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
                      To="Green" Duration="0:0:4" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Canvas.Triggers>
</Canvas>

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Media.Animation
Windows::UI::Xaml::Media::Animation [C++]

Metadata

Windows.winmd

See also

TriggerAction
Triggers
Storyboard
Quickstart: Control templates

 

 

Show:
© 2014 Microsoft