// Reading preview private void ReadPreview_button_Click(object sender, RoutedEventArgs e) { if (!selected_result_track.Equals(default(DeezerTrack))) { readPreview_button.IsEnabled = false; selectedTrack_readPreview_button.IsEnabled = false; blindtest.readPreview(selected_result_track); readPreview_button.Content = "Downloading preview..."; } }
// When a result has been selected in comboBox, loading information in UI private void Results_comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (results_comboBox.SelectedIndex != -1) { selected_result_track = blindtest.getTrack(results_comboBox.SelectedIndex); if (selected_result_track.Equals(default(DeezerTrack))) { title_label.Text = "Error"; artist_label.Text = "Error"; album_label.Text = "Error"; BitmapImage bmpImg = new BitmapImage(); bmpImg.UriSource = new Uri("ms-appx:///Assets/default-track.png"); track_Image.Source = bmpImg; } else { title_label.Text = selected_result_track.title; artist_label.Text = selected_result_track.artist.name; album_label.Text = selected_result_track.album.title; BitmapImage bmpImg = new BitmapImage(); bmpImg.UriSource = new Uri(selected_result_track.album.cover_medium); track_Image.Source = bmpImg; } } }