None of the above solutions worked for me. But this did:
myImage.Source = new BitmapImage(new Uri(@"/Images/foo.png", UriKind.Relative));
None of the above solutions worked for me. But this did:
myImage.Source = new BitmapImage(new Uri(@"/Images/foo.png", UriKind.Relative));