BeginStoryboard.Storyboard property

Applies to Windows and Windows Phone

Gets or sets the Storyboard that this BeginStoryboard starts.

Syntax


public Storyboard Storyboard { get; set; }


<BeginStoryboard>
  <Storyboard ...>
    oneOrMoreAnimations
  </Storyboard>
</BeginStoryboard>

XAML Values

oneOrMoreAnimations

One or more animation types that derive from Timeline. These provide the value of Storyboard.Children.

Property value

Type: Storyboard

The Storyboard that the BeginStoryboard starts. The default is null.

Remarks

Triggers, EventTrigger, 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.

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

Minimum supported server

Windows Server 2012

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

BeginStoryboard
Basic XAML syntax guide

 

 

Show:
© 2014 Microsoft