繁体   English   中英

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

[英]WinRT information: Cannot resolve TargetProperty in UWP

我是Storyboard动画的新手,

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)。

谁能帮我解决这个问题?

属性名称肯定是EndAngle ,因此您应该这样设置target属性:

Storyboard.SetTargetProperty(angleAnimation, "EndAngle");

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM