This Works:
Sending Uri
directly as a parameter to the constructor sets the UriSource
of the object photo
.
BitmapImage photo = new BitmapImage(new Uri("pack://application:,,,/Images/EmptyImage.jpg"));
Doesn't Work:
But setting the UriSource
property keeps the UriSource
as null
BitmapImage photo = new BitmapImage();
photo.UriSource = new Uri("pack://application:,,,/Images/EmptyImage.jpg");
According to MSDN
So you need to set it this way: