wpf-animation

Animation breaks binding

给你一囗甜甜゛ 提交于 2019-12-02 07:57:20
问题 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;