public static void Move(DependencyProperty dependencyProperty, UIElement element, double from, double to, double seconds, AnimationCompletedDelegate callback)
{
DoubleAnimation moveAnimation = new DoubleAnimation
{
From = from,
To = to,
Duration = new Duration(TimeSpan.FromSeconds(seconds))
};
if (callback != null)
{
moveAnimation.Completed += (sender, _) => callback(sender, _);
}
if (element.RenderTransform == null)
{
element.RenderTransform = new TranslateTransform();
}
element.RenderTransform.BeginAnimation(dependencyProperty, moveAnimation);
}