BeginStoryboard BeginStoryboard BeginStoryboard Class

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

Syntax

Declaration

public sealed class BeginStoryboardpublic sealed class BeginStoryboardPublic NotInheritable Class BeginStoryboard
<BeginStoryboard ...>
  singleStoryboard
</BeginStoryboard>

Inheritance Hierarchy

Remarks

Triggers, EventTrigger, Actions and BeginStoryboard are not commonly used. These API 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 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 Triggers with its default 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 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>

Constructors summary

Initializes a new instance of the BeginStoryboard class.

Properties summary

Gets or sets the Storyboard that this BeginStoryboard starts.

Identifies the Storyboard dependency property.

Constructors

  • BeginStoryboard()
    BeginStoryboard()
    BeginStoryboard()
    BeginStoryboard()

    Initializes a new instance of the BeginStoryboard class.

    public BeginStoryboard()public New()Public Sub New()public BeginStoryboard()

Properties

  • Storyboard
    Storyboard
    Storyboard
    Storyboard

    Gets or sets the Storyboard that this BeginStoryboard starts.

    public Storyboard Storyboard { get; set; }public Storyboard Storyboard { get; set; }Public ReadWrite Property Storyboard As Storyboardpublic Storyboard Storyboard { get; set; }
    <BeginStoryboard>
      <Storyboard ...>
        oneOrMoreAnimations
      </Storyboard>
    </BeginStoryboard>
    

    Property Value

    Remarks

    Triggers, EventTrigger, and BeginStoryboard are not commonly used. These API 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 Triggers with its default 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 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>
    
  • StoryboardProperty
    StoryboardProperty
    StoryboardProperty
    StoryboardProperty

    Identifies the Storyboard dependency property.

    public static DependencyProperty StoryboardProperty { get; }public static DependencyProperty StoryboardProperty { get; }Public Static ReadOnly Property StoryboardProperty As DependencyPropertypublic static DependencyProperty StoryboardProperty { get; }

    Property Value

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute
Windows.UI.Xaml.Markup.ContentPropertyAttribute

Details

Assembly

Windows.UI.Xaml.Media.Animation.dll