Silverlight - Databinding Images to URIs

imageMike's already blogged about this one so I'll simply highlight his post. I was building a simple music jukebox app to demo OpenFileDialog and IsolatedStorage. You can select some tracks to play and add them to a queue. The queue is maintained in isolated storage so queued tracks persist through a re-start. The app also uses a bit of WCF to resolve the URIs for the album cover image and the wma file.

All was well until I came to databind the images. This had worked when I'd set the image sources from code but when I started databinding them, no images appeared. Set the URI in XAML, all works fine. Via databinding, no image. The crux of the matter is that I was binding to a URI and there being no default converter for Uri to ImageSource (there is for String to ImageSource so setting in XAML works), it fails.

Read all about it in Mike's post.

Technorati Tags: silverlight,databinding