[英]Cannot resolve TargetProperty when using StoryBoard in WinRT
[英]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.