I managed to developp a storyboard to translate an object from its initial position to another position, but when I trigger the storyboard a second time, or call another storyboard, the object always translate from its initial position, not from the new one established after the first translation. How to change it ?
My code :
TranslateTransform animatedTranslateTransform = new TranslateTransform();
this.RegisterName("slide", animatedTranslateTransform);
TransformGroup transformGroup = new TransformGroup();
transformGroup.Children.Add(animatedTranslateTransform);
_button.RenderTransform = transformGroup;
//translate Y
DoubleAnimation slideDown = new DoubleAnimation(20, TimeSpan.FromSeconds(1.0));
Storyboard.SetTargetName(slideDown, "slide");
Storyboard.SetTargetProperty(slideDown, new PropertyPath(TranslateTransform.YProperty));
storyBoardSlideDown.Children.Add(slideDown);
Use DoubleAnimation.By instead of DoubleAnimation.To. From MSDN:
Write