private async void HandleGetLastFMArtButtonClick(object sender, RoutedEventArgs e) { noArtMessage.Visibility = Visibility.Collapsed; lastFMArtButton.IsEnabled = false; string LastFMArt = await LastFMManager.Current.GetAlbumArt(editAlbumArtistName.Text, editAlbumName.Text); if (!string.IsNullOrEmpty(LastFMArt)) { updateArt.IsChecked = true; BitmapImage bitmapImage = new BitmapImage(); bitmapImage.UriSource = new Uri(LastFMArt); ImagePreview.Source = bitmapImage; albumArtLastFMPath = LastFMArt; previewSource = ImagePreviewSource.LastFM; } else { noArtMessage.Visibility = Visibility.Visible; } lastFMArtButton.IsEnabled = true; }
private async void HandleEditAlbumLoaded(object sender, RoutedEventArgs e) { if (albumArtStorageFile != null) { using (IRandomAccessStream stream = await albumArtStorageFile.OpenAsync(FileAccessMode.Read)) { BitmapImage bitmapImage = new BitmapImage(); await bitmapImage.SetSourceAsync(stream); ImagePreview.Source = bitmapImage; previewSource = ImagePreviewSource.FilePicker; } } }
private async void HandleEditAlbumLoaded(object sender, RoutedEventArgs e) { if (albumArtStorageFile != null) { using (IRandomAccessStream stream = await albumArtStorageFile.OpenAsync(FileAccessMode.Read)) { BitmapImage bitmapImage = new BitmapImage(); await bitmapImage.SetSourceAsync(stream); ImagePreview.Source = bitmapImage; previewSource = ImagePreviewSource.FilePicker; } } }
private async void HandleGetLastFMArtButtonClick(object sender, RoutedEventArgs e) { noArtMessage.Visibility = Visibility.Collapsed; lastFMArtButton.IsEnabled = false; string LastFMArt = await LastFMManager.Current.GetAlbumArt(editAlbumArtistName.Text, editAlbumName.Text); if (!string.IsNullOrEmpty(LastFMArt)) { updateArt.IsChecked = true; BitmapImage bitmapImage = new BitmapImage(); bitmapImage.UriSource = new Uri(LastFMArt); ImagePreview.Source = bitmapImage; albumArtLastFMPath = LastFMArt; previewSource = ImagePreviewSource.LastFM; } else { noArtMessage.Visibility = Visibility.Visible; } lastFMArtButton.IsEnabled = true; }