private void DetachBitmapSourceEvents() { if (_bitmapSource != null) { DownloadCompletedEventManager.RemoveHandler(_bitmapSource, OnSourceDownloaded); DownloadFailedEventManager.RemoveHandler(_bitmapSource, OnSourceFailed); DecodeFailedEventManager.RemoveHandler(_bitmapSource, OnSourceFailed); _bitmapSource = null; } }