I have a generic Storyboard defined in my XAML as follows:
<Storyboard Core:Key="GenericAnimation" Completed="OnStoryboardCompleted"/> And in my code-behind as follows:
m_GenericAnimation = (Storyboard)Resources["GenericAnimation"]; Every Storyboard of my applications shares the same Completed event OnStoryboardCompleted. I would like to change a little bit the behavior of my event depending on the animation that is just being completed like so (pseudocode):
private void OnStoryboardCompleted(object sender, EventArgs e) { if (completedStoryboard == m_GenericAnimation) DoSomethingSpecific(); DoSomethingCommon(); } How can I retrieve the currently completed Storyboard from sender? How can I correctly compare two Storyboard objects?