wpfanimationstoryboardpixelsensescatterview

While pausing a Storyboard, Does the Property being animated get locked ? Does the AnimationClock stops?


ParallelTimeline OTimelineAnimation = new ParallelTimeline();

for (int i = 0; i < _Bubbles.Count; i++)
{
 _StryBrd.Children.Clear();

 PointAnimation ToMovePointAnim = new PointAnimation();
 ToMovePointAnim.From = _Bubbles[i].CurrentPoint;
 ToMovePointAnim.To = _Bubbles[i].ToNextPoint;
 ToMovePointAnim.Duration = new Duration(TimeSpan.FromSeconds(1.5));
 ToMovePointAnim.FillBehavior = FillBehavior.Stop;

 Storyboard.SetTarget(ToMovePointAnim, _Bubbles[i].CurrentElement);
 Storyboard.SetTargetProperty(ToMovePointAnim, new PropertyPath(ScatterViewItem.CenterProperty));

 OTimelineAnimation.Children.Add(ToMovePointAnim);

 _Bubbles[i].CurrentElement.Center = _Bubbles[i].ToNextPoint;
 _Bubbles[i].CurrentPoint = _Bubbles[i].ToNextPoint;
 _Bubbles[i].ToNextPoint = GetToNextPoint(_Bubbles[i].ToNextPoint);
}

_StryBrd.Children.Add(OTimelineAnimation);
_StryBrd.Begin(this,  true);


// At another part X, I call the following
_StryBrd.Pause(this);

// At another part Y, I call the following
_StryBrd.Resume(this);

Problem:

While I try to drag any of these "ScatterViewItem" elements which internally ( I guess ! ) it is accessing the "ScatterViewItem.CenterProperty" somehow to change the position of the elements, its not being dragged.

Is this the default behaviour for pausing a storyboard ? ( To lock the property from being changed )

I hope I had clarified enough, Thank all in advance


Solution

  • Well, animations have quite extreme precedence, you cannot modify animated properties, even when paused. Just setting a property after an animation is trouble enough, here you also would need to get rid of the animation to change it.