Silverlight XAML Primer 11: Getting Started with Animations: Listing 1. Using storyboards and animations in Silverlight.

<Canvas xmlns="http://schemas.microsoft.com/client/2007">
    <Canvas.Triggers>
        <EventTrigger RoutedEvent="Canvas.Loaded">
            <BeginStoryboard>
                <Storyboard>
	     <DoubleAnimation AutoReverse="True" From="80" To="200" 
                       Duration="0:0:3" 
	        Storyboard.TargetName="tbHello"
	        Storyboard.TargetProperty="(Canvas.Left)" RepeatBehavior="Forever"/>
	 </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Canvas.Triggers>
    <Canvas Canvas.Left="10" Canvas.Top="10" Height="300" Width="300" Background="#efefef">
        <Rectangle Canvas.Top="25" Canvas.Left="25" 
            Width="200" Height="150" Fill="Yellow" />
        <TextBlock Name="tbHello"
             Canvas.Left="36" Canvas.Top="80"
             Foreground="Maroon" FontFamily="Verdana" 
             FontSize="24" FontWeight="Bold"
             Text="Hello From Silverlight!">
        </TextBlock>
    </Canvas>
</Canvas>
comments powered by Disqus

Featured

  • Spring AI 2.0 Goes GA, Giving Java Developers a More Mature AI App Stack

    Spring AI 2.0 advances the Java framework for generative AI apps with a Spring Boot 4 baseline, cleaner agentic tooling, Model Context Protocol support and vendor-backed integrations including Azure Cosmos DB.

  • Kubernetes for Developers

    Microsoft's Dan Wahlin previews his introductory "Kubernetes for Developers" session at Visual Studio Live! San Diego 2026, explaining how developers can get past the Kubernetes learning curve by starting locally, mastering Pods first, and using Services to make containerized applications reliably accessible.

  • VS Code Keeps Eye on Costs in v1.126 Update

    Visual Studio Code 1.126 adds session-level Copilot cost information, continuing Microsoft's recent focus on helping developers monitor and manage usage-based GitHub Copilot billing.

  • Open VSX 1.0.0 Puts Focus on Open Extension Registry for VS Code Ecosystem

    Eclipse Open VSX has reached 1.0.0, highlighting its role as a vendor-neutral registry for VS Code-compatible extensions.

Subscribe on YouTube