I want to use a ColorAnimation on the FillColor Property of a MapPolygon.
I created a HeatMap with the BingMap
Control for UWP
Heatmap Preview
I got a function, where i calculate a new FillColor
for each MapPolygon
. I want now to use a ColorAnimation
instead of just changing the FillColor
from the old value to the new value.
//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();
But with the storyboard code i always get an System.Runtime.InteropServices.COMException
which tells me the Animation target not specified.
I tried a lot of values for the second parameter of the Storyboard.SetTargetproperty
... nothing worked.
What am I missing?