wasteam / waslibs

Windows App Studio WinRT XAML & UWP Libraries
MIT License
314 stars 133 forks source link

Caching issue with ImageEx control #35

Closed darshanrampatel closed 8 years ago

darshanrampatel commented 8 years ago

I'm seeing a caching issue with the ImageEx control.

  1. Set up a ImageEx control, with a Source bound to a URL (e.g. http://someurl/picture.jpg), and an ImageFailed failed function:
        private void Image_ImageFailed(object sender, ExceptionRoutedEventArgs e)
        {
            Image img = sender as Image;
            BitmapImage fallbackImage = new BitmapImage(new Uri("ms-appx:///Assets/Placeholder.png"));
            img.Width = 256;
            img.Height = 256;
            img.Source = fallbackImage;
        }
  1. This image doesn't exist on the server, so we enter the ImageFailed function - the placeholder image is successfully displayed.
  2. However, the image is updated later on and exists - when trying to display this image, we again drop into ImageFailed, though the img.Source that is trying to be displayed is of the form:
UriSource   {ms-appdata:///temp/ImageCache/M.4108359629163884465.jpg}

I think that a cache image is trying to be created, but, since the image doesn't exist when initially loading and creating the cache, it still stores a reference to the cache image which doesn't exist.

javitosanchez commented 8 years ago

Thanks for reporting this. It's solved in DEV branch. We will merge to master in our next release. If you cannot wait, you can work with the DEV branch.

javitosanchez commented 8 years ago

Resolved in the current version (1.5.0)

darshanrampatel commented 8 years ago

@javitosanchez Thanks!