You have already learned how to animate the color and size of an element, but what about its position? Could you create some animations regarding the location of an element? Of course! In this recipe, you will get to know how to do it.
To prepare the example that animates the square position, perform the following steps:
Add a square to the page and define a storyboard for moving the square. Do this by modifying the content of the
MainPage.xaml
file, as follows:<Page (...)> <Page.Resources> <Storyboard x:Name="RectangleMove"> <DoubleAnimation Storyboard.TargetName="RectangleMain" Storyboard.TargetProperty="(Canvas.Left)" To="350" Duration="0:0:1" /> ...