Search code examples
c#wpfanimationpixelsense

MS Surface animating an SVI along a straight line


So I'm attempting to move a ScatterViewItem from 1 point to the another. I've tried using PointAnimation. However, after the animation completes I can't move the item from the To point. I can spin the item and scale it, but for some reason can not move it.

It's a simple movement from 1 point to the next in a straight line. Should I be using PointAnimation or is there a better way? Thanks I'm doing this in C#

My point animation code:

        oPointAnimation = new PointAnimation();
        oPointAnimation.From = new Point(439, 113);
        oPointAnimation.To = new Point(139, 160);

        oPointAnimation.Duration = TimeSpan.FromSeconds(4);
        oPointAnimation.Completed += new EventHandler(oPointAnimation_Completed);
        theCard.BeginAnimation(ScatterViewItem.CenterProperty, oPointAnimation);

Solution

  • I guess you need to use FillBehaviour of the POintAnimation to FillBehavior="Stop"