[英]WinRT information: Cannot resolve TargetProperty in UWP
I'm new to Storyboard animation, 我是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();
I try to animate each segments in the PieSegmentCollection, but i got this error 我尝试为PieSegmentCollection中的每个片段设置动画,但出现此错误
WinRT information: Cannot resolve TargetProperty (PieSegment.ArcEndAngleProperty) on specified object. WinRT信息:无法解析指定对象上的TargetProperty(PieSegment.ArcEndAngleProperty)。
Can anyone help me to resolve this problem? 谁能帮我解决这个问题?
属性名称肯定是EndAngle
,因此您应该这样设置target属性:
Storyboard.SetTargetProperty(angleAnimation, "EndAngle");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.