How would you go about to change the current source of an image from the .cs file? I’ve tried this:
file.xaml.cs:
BitmapImage yesImage = new BitmapImage(new Uri("/Test;component/Images/yes.png")); // new source address
img.Source = yesImage; // update source of img
The xaml file has a control <image Name="img" /> residing in it.
I got it working now. I changed the “Build Action” of the images to “Content” and since the images are local to the project i removed “/Test;component/” and I also added UriKind.Relative to the URI object.