title: WPF: How to get currently active Storyboard/Animation for a given element?
body: <p>I am running some animations from code behind that animate Opacity of an element. There are two animations, one is reducing Opacity from current value to 0 and other is increasing Opacity from current value to 1. The problem is that it could happen that one of these animations might be started while the previous one is not done... so they are both changing the Opacity property at the same time and that looks bad. What I need instead is to stop any current animation (storyboard) before I start the next animation of these animations. I hope I was clear enough... So the question is basically, for a given element how can I get active Storyboard/Animations in order to stop them? This is for code behind question since it seems that XAML defined animations do this automatically.</p>