Tag Archives: Image

Set the source for an image from C#

In Silverlight, there are two ways to set the source for an image.

image.SetValue(Image.SourceProperty,value);
image.Source = new BitmapImage(new Uri(value, UriKind.Absolute));

For the second option you will need to include the following namespace: using System.Windows.Media.Imaging;.