Tag Archives: Image

Set Source on Image from code in Silverlight

31 Dec

One of the questions that I get a lot and often answers on forums is how to set the Source property on an Image from code.

In XAML it’s really straightforward – you simply set the Source to a string value.


What’s actually going on is an implicit conversion of the string to and ImageSource.


From code you can use the ImageSourceConverter as well; or you can use a BitmapImage and an Uri (the way I often do it).


by xamlgeek