Could someone please show me how to animate a window from its current position. I am looking for a shake effect which simply shakes the window left and right say 5 to 6 times.
I understand that I need to use Animation.By. This is something I have started but am not getting far.
This However does not work.
<Storyboard x:Key="sbShake1" FillBehavior="Stop">
<DoubleAnimation Storyboard.TargetName="W1" Storyboard.TargetProperty ="(Window.Left)"
By="10" Duration="0:0:1">
</DoubleAnimation >
</Storyboard >
I have managed to get the right shake effect but I cannot do it from the windows current position.
<Storyboard x:Key="sbShake" RepeatBehavior ="00:00:01" SpeedRatio ="25" >
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty ="Left">
<SplineDoubleKeyFrame KeyTime ="00:00:00.1000000" Value ="-10"/>
<SplineDoubleKeyFrame KeyTime ="00:00:00.3000000" Value ="0"/>
<SplineDoubleKeyFrame KeyTime ="00:00:00.5000000" Value ="10"/>
<SplineDoubleKeyFrame KeyTime ="00:00:00.7000000" Value ="0"/>
</DoubleAnimationUsingKeyFrames >
</Storyboard >
All help would be appreciated.