How can I keep a WPF Image from blocking if the ImageSource references an unreachable Url?

Posted by Corey O'Brien on Stack Overflow See other posts from Stack Overflow or by Corey O'Brien
Published on 2010-03-17T16:07:02Z Indexed on 2010/03/17 16:11 UTC
Read the original article Hit count: 361

Filed under:
|
|

I'm writing a WPF application and trying to bind an image to my view model with the following XAML:

<Image Source="{Binding Author.IconUrl, IsAsync=True}" />

The problem is that the image URLs are defined by users and can often refer to images hosted on intranet web servers. When the WPF application is run remotely, it locks up while trying to resolve the images that are now unreachable.

I thought the "IsAsync" binding property would cause the load to happen in the background, but it appears that the DNS resolution may still happen in the main thread?

What can I do to keep my app from locking, even if the images are unreachable?

Thanks, Corey

© Stack Overflow or respective owner

Related posts about wpf

Related posts about images