0
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);

问题:

当我尝试拖动任何内部的“ScatterViewItem”元素时(我猜!)它正在以某种方式访问​​“ScatterViewItem.CenterProperty”以更改元素的位置,但它没有被拖动。

这是暂停情节提要的默认行为吗?(锁定属性不被更改)

我希望我已经澄清了,提前谢谢大家

4

1 回答 1

1

好吧,动画具有非常高的优先级,您不能修改动画属性,即使在暂停时也是如此。只是在动画之后设置一个属性就很麻烦了,在这里你还需要摆脱动画来改变它。

于 2011-12-13T15:50:35.000 回答