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

本文关键字:UWP 中的 TargetProperty 信息 WinRT | 更新日期: 2023-09-27 18:12:47

我是新来的故事板动画,

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信息:Cannot resolve TargetProperty(piessegment . arcendangleproperty) .

谁能帮我解决这个问题?

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

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

Storyboard.SetTargetProperty(angleAnimation, "EndAngle");