I have this definition in my XAML:
<Image Name="AlbumArt" Source="/AlbumChooser2;component/Resources/help.png" />
The image starts at startup. Ok
In my code, I am looking for mp3s to play, and I am showing the associated album art in this Image. Now, if there is no linked image, I want to display the "no image" image. So, I have one specific one, and I load it using:
BitmapImage noImage = new BitmapImage(
new Uri("/AlbumChooser2;component/Resources/no_image.png",
UriKind.Relative));
I have a helper class that finds an image if it is (returns it as BitmapImage), or returns null if it is not:
if (findImage.Image != null)
{
this.AlbumArt.Source = findImage.Image;
}
else
{
this.AlbumArt.Source = noImage;
}
In the event that an image is found, the source is updated and the album art is displayed. In the case when the image is not found, I do not see anything - just a space.
, AlbumArt.Source , BitmapImage.
, (, ), " ", . ?