WinRT信息:无法解析UWP中的TargetProperty

时间:2016-10-13 05:00:12

标签: c# storyboard uwp

我是故事板动画的新手,

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

我尝试在PieSegmentCollection中为每个段设置动画,但是我收到了此错误

  

WinRT信息:无法解析TargetProperty   (PieSegment.ArcEndAngleProperty)指定对象。

有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

这个名称当然是EndAngle,所以你应该这样设置目标属性:

Storyboard.SetTargetProperty(angleAnimation, "EndAngle");