Hello, the animation you want can be created from the following structure:
<Grid x:Name="Background">
<Grid.Triggers>
<EventTrigger RoutedEvent="Grid.Loaded">
<BeginStoryboard>
<Storyboard>
<ThicknessAnimation Storyboard.TargetProperty="item1" From="item2" To="item3" DecelerationRatio="0.9" Duration="0:0:0.5"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
Explaining Better
Within your control (in the case of the grid), you add the container Triggers (trigger) that will trigger your event, then set Eventtrigger as event container and Beginstoryboard to explore what happens at the beginning of the event and Routedevent receives the name of the animation target control and its trigger, the structure can change depending on the animation you want.
item1 is the target property, where animation will be applied.
item2 the initial value of this property.
item3 the final value of this property.
Duration is the duration of the animation, in the above example is 1/2 second.
for more details:
https://www.codeproject.com/Articles/364529/Animation-using-Storyboards-in-WPF
https://msdn.microsoft.com/pt-br/library/ms742868(v=vs.110). aspx
source:
https://msdn.microsoft.com/pt-br/library/ms742868(v=vs.110). aspx