Archive for the ‘Image’ Tag

Set the source for an image from C#

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

  1. image.SetValue(Image.SourceProperty,value);
  2. 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;.