This project is read-only.

LoadingFailed event removed before calling

Aug 5, 2011 at 11:12 PM

I forgot to set the decorators and expected to see an exception

This is my code:

ExtendedImage extendedImage = new ExtendedImage();
extendedImage.LoadingFailed += new EventHandler<UnhandledExceptionEventArgs>(extendedImage_LoadingFailed);

The exception in thrown and catched by the AnimatedImage:

 private void image_LoadingFailed(object sender, UnhandledExceptionEventArgs e)
            ExtendedImage image = sender as ExtendedImage;

            Dispatcher.BeginInvoke(() =>
                    image.LoadingCompleted -= new EventHandler(image_LoadingCompleted);
                    image.LoadingFailed -= new EventHandler<UnhandledExceptionEventArgs>(image_LoadingFailed);
It seems that the eventhandler is removed before it reach my extendedImage_LoadingFailed 
What could be wrong?