I have a ComboBox
whose Opacity
property has the following binding:
Opacity="{Binding ElementName=stackPanel, Path=IsMouseOver, Converter={StaticResource mouseOverConverter}}"
Basically, if the IsMouseOver
property is true, the ComboBox
has an Opacity
of 1, otherwise 0.4.
Now I apply this animation to the ComboBox
:
private void AnimateComboBox()
{
DoubleAnimation da = new DoubleAnimation();
da.From = 0.4;
da.To = 1;
da.Duration = TimeSpan.FromSeconds(0.8);
da.AutoReverse = true;
ComboClassList.BeginAnimation(ComboBox.OpacityProperty, da);
}
That works well, but afterwards the binding of the ComboBox
doesn't work anymore. The Opacity
doesn't change when I move my mouse over the StackPanel
. Why does the animation break my binding? Snoop says, the binding still exists, altough it's highlighted red in Snoop.