Reputation: 516
I have a double animation which worked well on one control. Now I want to make it universal. How do I get current canvas of a control? For example I want to use this animation on window and it always showed from 13 to 17 while I need from 'current position' to 'current position + 4'
<BeginStoryboard x:Key="SomethingWrongAnimation">
<Storyboard Storyboard.TargetProperty="(Canvas.Left)">
<DoubleAnimation From="13" To="17" Duration="0:0:0.05"
AutoReverse="True" FillBehavior="Stop" RepeatBehavior="5x"/>
</Storyboard>
</BeginStoryboard>
Upvotes: 0
Views: 108
Reputation: 128061
Instead of From
and To
set the By
property:
<DoubleAnimation By="4" ... />
Upvotes: 1