I have a DataTrigger
that animates Background.Color
on a Grid Row. It works good when Background
is of type SolidColorBrush because that has a Color property.
But when that Grid Row is highlighted, the Background becomes LinearGradientBrush which does not have a Color property and my storyboard fails with an exception. How do I deal with that ?
Here is my Trigger
<DataTrigger Binding="{Binding Row.State}" Value="Finished">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard >
<ColorAnimation
Storyboard.TargetProperty="Background.(Color)"
To="LightGreen" Duration="0:0:1" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
Here is the exception that I get when row is highlighted.
Additional information: Cannot resolve all property references in the property path 'Background.(Color)'. Verify that applicable objects support the properties.