I'd like to animate a Button
's Background
if the Mouse is over the Button
.
The Button
's Background
is bound to a custom dependency property I've created in the Code Behind of my UserControl
... Background="{Binding BGColor, Elementname="QButton"}"
Now if I try to animate the Button's background by using
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ColorAnimation To="LightBlue"
Duration="0:0:2"
Storyboard.TargetProperty="Background.Color"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
I get an exception that says:
cannot animate an immutable property (or similar).
How do I solve this issue?