RectNavigation.Animate.Move C# (CSharp) Method

Move() public static method

public static Move ( DependencyProperty dependencyProperty, UIElement element, double from, double to, double seconds, AnimationCompletedDelegate callback ) : void
dependencyProperty System.Windows.DependencyProperty
element System.Windows.UIElement
from double
to double
seconds double
callback AnimationCompletedDelegate
return void
        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);
        }

Same methods

Animate::Move ( UIElement element, Point to ) : void
Animate::Move ( UIElement element, Point from, Point to, double seconds, AnimationCompletedDelegate callback ) : void
Animate::Move ( UIElement element, double x, double y ) : void