I have the following code:
<Color x:Key="SelectedColor">Gold</Color>
And a TabItem Style that contains the color
<VisualState x:Name="Selected">
<Storyboard>
<ColorAnimationUsingKeyFrames
Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
Storyboard.TargetName="InnerRectangle2">
<EasingColorKeyFrame KeyTime="0" Value="{DynamicResource SelectedColor}"/>
</ColorAnimationUsingKeyFrames>
It turns out I can't use a DynamicResource
on an EasingColorKeyFrame
.
What can I do to achieve my effect?
I need to set the color dynamically, so just swapping "{DynamicResource SelectedColor}"
with "{StaticResource SelectedColor}"
is off the table.
I've created a tiny solution to demonstrate the problem - the Selected Tab should be Gold colored, but it's actually transparent, because I guess the VSM can't resolve the color named "SelectedColor
"