问题描述:

I'm new to Storyboard animation,

Storyboard storyBoard = new Storyboard();

foreach (var segment in this.PieSegmentCollection)

{

DoubleAnimation angleAnimation = new DoubleAnimation() { From = StartAngle, To = EndAngle, Duration = new Duration(TimeSpan.FromSeconds(.8)) };

storyBoard.Children.Add(angleAnimation);

Storyboard.SetTargetProperty(angleAnimation, "PieSegment.EndAngleProperty");

Storyboard.SetTarget(angleAnimation, segment);

}

storyboard.Begin();

I try to animate each segments in the PieSegmentCollection, but i got this error

WinRT information: Cannot resolve TargetProperty

(PieSegment.ArcEndAngleProperty) on specified object.

Can anyone help me to resolve this problem?

网友答案:

The propery name is certainly EndAngle, so you should set the target property this way:

Storyboard.SetTargetProperty(angleAnimation, "EndAngle");
相关阅读:
Top