It is a lot easier than you think. The cool thing about Animations in WPF and Silverlight is that they can be relative to the current situation. The only thing you need to do to create a relative animation is creating for example the DoubleAnimation with To filled in but do NOT fill in the From.
Example below is to animate the opacity of a stackpanel from the current value to 1:
<DoubleAnimation Duration="0:0: To="1"
Storyboard.TargetName="LayoutRoot"
Storyboard.TargetProperty="StackPanel.Opacity" />
EDIT1:
Make the animation loop back to its original value without using the from and loop forever
<Storyboard AutoReverse="True" RepeatBehavior="Forever">
<DoubleAnimation Duration="0:0:2"
To="1"
Storyboard.TargetName="LayoutRoot"
Storyboard.TargetProperty="StackPanel.Opacity"
/>
</Storyboard>
Wouter Janssens - Xelos bvba
2010-08-19 11:18:26