Creating an Animation in XAML and Silverlight

Published on February 23, 2014 by Senthil Kumar

Filed under Windows

Last modified February 23, 2014

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 1.5 (2 votes)

This article have been viewed 15004 times

Below is a sample code snippet that demonstrates how to create a simple animation in XAML and Silverlight

Creating an Animation in XAML and Silverlight

<Grid x:Name="LayoutRoot" Background="White">

<Canvas x:Name="ACCanvas" xmlns=""


Width="400" Height="300" >


<SolidColorBrush Color="Yellow"/>


<Rectangle Width="190" Height="160"

Fill="Red" Stroke="Green"

Canvas.Left="0" Canvas.Top="50" RenderTransformOrigin="0,0" >



<RotateTransform x:Name="RotateTransform"


<ScaleTransform x:Name="ScaleTransform"

ScaleX="0" ScaleY="0" />






<EventTrigger RoutedEvent="Grid.Loaded">


<Storyboard AutoReverse="True" RepeatBehavior="Forever">


Storyboard.TargetName="ScaleTransform" Storyboard.TargetProperty="ScaleX" From="0" To="1" Duration="0:0:3"/>

<DoubleAnimation Storyboard.TargetName="ScaleTransform" Storyboard.TargetProperty="ScaleY" From="0" To="1" Duration="0:0:3"/>





Leave a Comment


You might be Interested in these Posts

How to Turnoff Frame rate counter in UWP App ?

You can turn off the frame rate counter in your Universal Windows Platform (UAP) apps by following t...

Creating a Button in UWP app by specifying the namespace as one of the attributes of button

You can add a button in your Universal Windows Platform (UWP) app by simply adding the Button tag in...

Keywords in XAML Language Namespace

Below are some of the keywords defined in the Xaml Language Namespace Keywords in XAML Language Nam...