0
votes

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?

1

1 Answers

1
votes

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

Storyboard.SetTargetProperty(angleAnimation, "EndAngle");