Pausing and resuming a storyboard with triggers : Storyboard « Animations « Silverlight






Pausing and resuming a storyboard with triggers

    


<UserControl x:Class='SilverlightApplication3.MainPage'
    xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' 
    xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
    xmlns:d='http://schemas.microsoft.com/expression/blend/2008' 
    xmlns:mc='http://schemas.openxmlformats.org/markup-compatibility/2006' 
    mc:Ignorable='d' 
    d:DesignWidth='640' 
    d:DesignHeight='480'>
        
        <Ellipse Name="myEllipse" Fill="Red" Height="100" Width="10">
          <Ellipse.Triggers>
            <EventTrigger RoutedEvent="Ellipse.MouseEnter">
              <BeginStoryboard>
                <Storyboard>
                  <DoubleAnimation Storyboard.TargetProperty="(Ellipse.Width)"
                                   To="300" Duration="0:0:5" />
                </Storyboard>
              </BeginStoryboard>
            </EventTrigger>

          </Ellipse.Triggers>
        </Ellipse>
</UserControl>

   
    
    
    
  








Related examples in the same category

1.Rectangle Trigger and StoryboardRectangle Trigger and Storyboard
2.Storyboard EventsStoryboard Events
3.Storyboard PropertiesStoryboard Properties
4.Storyboard as ResourceStoryboard as Resource
5.Events of StoryBoardEvents of StoryBoard
6.Use two storyboards to control the slidein and slideoutUse two storyboards to control the slidein and slideout
7.Defining a Storyboard as a resource
8.Starting a Storyboard from code-behind
9.Syntax of Storyboard element with multiple animations
10.Animation overriding target of its parent StoryboardAnimation overriding target of its parent Storyboard
11.Start a story board with code
12.An animation that uses the playback methods and the Completed event