Silverlight XAML Primer 13: Starting and Stopping Animations: Listing 2: Defining a Storyboard inside of a resources section.

<Canvas xmlns="http://schemas.microsoft.com/client/2007">
  <Canvas.Resources>
    <Storyboard Name="TextBlockAnimation" 
     Storyboard.TargetName="tbCanvas">
      <DoubleAnimationUsingKeyFrames
        Storyboard.TargetProperty="(Canvas.Left)" Duration="0:0:3"
        AutoReverse="True" RepeatBehavior="Forever">
        <LinearDoubleKeyFrame Value="50" KeyTime="0:0:2" />
        <LinearDoubleKeyFrame Value="200" KeyTime="0:0:3" />
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
  </Canvas.Resources>	
  <!-- More XAML code follows -->
</Canvas>
comments powered by Disqus
Upcoming Events

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.