I the previous articles Your first animations using XAML and Silverlight - Color animation: Part I and Your first animations using XAML and Silverlight- Double animation: Part II, we discovered how to deal with ColorAnimation and DoubleAnimation classes. In this one we will show how to deal with PointAnimation class to perform a linear interpolation movement between two points of a given object. As a first step, we will perform this with xaml then we will do the same animation using the C# code.
If you have already developed Adobe Flash projects like me, you will observe that this kind of animation class helps to perform the same task as a given linear interpolation movement done with flash.
Ok, let's consider an ellipse that moves from a point to another as mentioned within this bellow presentation:

Figure 1
To perform this, I propose this xaml and C# code:
XAML Code:
<Window x:Class="myWpfApplication.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="400" Width="400" Loaded="Window_Loaded">
<!--I used canvas this once as container to host child element -->
<Canvas>
<!--Don't confuse with System.IO.Path class
this one is System.Windows.Shapes.Path witch
is responsible to draw curves-->
<Path Fill="Beige" Margin="0,0,200,200">
<Path.Data>
<!-- Describes an ellipse. -->
<EllipseGeometry x:Name="MyAnimatedEllipseGeometry"
Center="200,110" RadiusX="150" RadiusY="100" />
</Path.Data>
<Path.Triggers>
<!--The Loaded event of the path class will
trigger the point aniamtion-->
<EventTrigger RoutedEvent="Path.Loaded">
<BeginStoryboard Name="MyBeginStoryboard">
<Storyboard>
<!-- Animate the Center property so that the ellipse animates from
one point on the screen to another. -->
<PointAnimation

Join the conversation! Your thoughts help the community grow.