Cache image in CustomCell for the ListView

AbhumMumbhauAbhumMumbhau USMember ✭✭
edited August 2017 in Xamarin.Forms

Hi. I created a custom cell template correctly binded to the data. How to cache image?

My idea was to use a cache image but the binding appears after the object creation so it doesn't work.
Here an example of the code.

    UriImageSource cacheImage = new UriImageSource();
    userImage.SetBinding(Image.SourceProperty, "PhotoURL");
    cacheImage.Uri = new Uri(userImage.Source == null ? "http://lorempixel.com/50/150/" : userImage.Source.ToString());
    userImage.Source = cacheImage;`

Best Answer

Answers

Sign In or Register to comment.