我想在 MapPolygon 的 FillColor 属性上使用 ColorAnimation。
我使用BingMap
UWP
热图预览控件创建了一个热图
我有一个函数,我在其中FillColor
为每个MapPolygon
. 我现在想使用 aColorAnimation
而不仅仅是将FillColor
旧值更改为新值。
//Instead of
statePolygon.FillColor = backGroundColor;
//I want to use something like the following
Storyboard storyboard = new Storyboard();
ColorAnimation animation = new ColorAnimation();
animation.From = statePolygon.FillColor;
animation.To = newBackGroundColor;
animation.Duration = new Duration(new TimeSpan(0, 0, 0, 5));
storyboard.Children.Add(animation);
Storyboard.SetTargetProperty(animation, "(MapPolygon.FillColor)");
Storyboard.SetTarget(myStoryboard, statePolygon);
storyboard.Begin();
但是使用情节提要代码,我总是得到一个System.Runtime.InteropServices.COMException
告诉我未指定动画目标的信息。
我为 ... 的第二个参数尝试了很多值,但Storyboard.SetTargetproperty
没有任何效果。
我错过了什么?