当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - WinRT information: Cannot resolve TargetProperty in UWP

问题描述:

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");
分享给朋友:
您可能感兴趣的文章:
随机阅读: