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 に答える