private void GetAlbumart()
{
if (_selectedSong == null)
_selectedSong = SongGrid.SelectedItem as Itemsource.Songs;
if (_selectedSong != null)
{
var tagFile = File.Create(_selectedSong.FileName);
try
{
var pic = tagFile.Tag.Pictures[0];
var ms = new MemoryStream(pic.Data.Data);
ms.Seek(0, SeekOrigin.Begin);
var bitmap = new BitmapImage();
bitmap.BeginInit();
bitmap.StreamSource = ms;
bitmap.EndInit();
var img = new Image {Source = bitmap};
AlbumArt.Source = img.Source;
AlbumArt.ToolTip = tagFile.Tag.Album;
Placeholder.Visibility = Visibility.Hidden;
}
catch
{
AlbumArt.Source = null;
AlbumArtToolTip.ToolTip = tagFile.Tag.Album;
Placeholder.Visibility = Visibility.Visible;
}
}
}