Storyboard Property
Collapse the table of content
Expand the table of content

VisualTransition.Storyboard Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets the Storyboard that occurs when the transition occurs.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

'Declaration
Public Property Storyboard As Storyboard
<object>
  singleStoryboard
</object>

XAML Values

singleStoryboard

Exactly one Storyboard object element.

Storyboard is the XAML content property of VisualTransition and can thus support this content element syntax, as opposed to having to specify object.StoryBoard as a property element.

Property Value

Type: System.Windows.Media.Animation.Storyboard
The Storyboard that occurs when the transition occurs.

When a VisualTransition contains a Storyboard, the Storyboard runs anytime the VisualTransition is applied. For example, if you want the border of a Button to change colors when the user moves the mouse away from it, you can create a VisualTransition that has a Storyboard that changes the button's background.

The following example creates a VisualTransition that specifies that when the user moves the pointer away from the control, the control's border changes to blue, then to yellow, then to black in 1.5 seconds.


<!--Take one and a half seconds to transition from the
    MouseOver state to the Normal state. 
    Have the SolidColorBrush, BorderBrush, fade to blue, 
    then to yellow, and then to black in that time.-->
<VisualTransition From="MouseOver" To="Normal" 
                      GeneratedDuration="0:0:1.5">
  <Storyboard>
    <ColorAnimationUsingKeyFrames
      Storyboard.TargetProperty="Color"
      Storyboard.TargetName="BorderBrush"
      FillBehavior="HoldEnd" >

      <ColorAnimationUsingKeyFrames.KeyFrames>

        <LinearColorKeyFrame Value="{StaticResource PhoneSubtleColor}" 
                             KeyTime="0:0:0.5" />
        <LinearColorKeyFrame Value="{StaticResource PhoneContrastBackgroundColor}" 
                             KeyTime="0:0:1" />
        <LinearColorKeyFrame Value="{StaticResource PhoneForegroundColor}" 
                             KeyTime="0:0:1.5" />

      </ColorAnimationUsingKeyFrames.KeyFrames>
    </ColorAnimationUsingKeyFrames>
  </Storyboard>
</VisualTransition>


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft