If the handler is useless (I cannot find a way to return the animated element), you can simply raise another event that contains this information:
private event EventHandler FadeAnimationCompleted; private void OnFadeAnimationCompleted(object sender) { var handler = FadeAnimationCompleted; if (handler != null) handler(sender, null); }
FadeAnimationCompleted += new EventHandler(This_FadeAnimationCompleted); FadeOutAnim.Completed += (s, _) => OnAnimationCompleted(element);
void This_FadeAnimationCompleted(object sender, EventArgs e) {
It would be even simpler to make a direct call method in the delegate:
FadeOutAnim.Completed += (s, _) => FadeAnimationCompleted(element);
void FadeAnimationCompleted(UIElement element) {
source share