2

I am setting the ImageUrl of a StyledStringElement, but do not know if the url exists. I'd like to put in an placeholder image that is used until the image is successfully downloaded:

    var item = new StyledStringElement(n.Title);
        item.ImageUri = new Uri(n.ImageThumbUrl);

I get this now:

enter image description here

Ian Vink
  • 66,960
  • 104
  • 341
  • 555

1 Answers1

2

Helpful: http://yusinto.blogspot.ca/2012/05/background-image-downloading-with.html

I copied the StyledStringElement to a new StyledStringElementLoader and edited this code:

    if (extraInfo.Uri != null)
    {   img = ImageLoader.DefaultRequestImage (extraInfo.Uri, this);
        if(img==null)
            img=myLoaderImagePassedToConstructor;
    }
Ian Vink
  • 66,960
  • 104
  • 341
  • 555