private void MusicItem_Click(object sender, RoutedEventArgs e) { Button item = (Button)sender; MusicBean music = (MusicBean)item.Tag; StartMusicDetailPanel(music); }
private async void LoadTrackList(MusicBean music) { await Task.Run(() => { var url = String.Format("{0}/music/{1}/track", HOST, music.id); var result = _client.Get(url); var data = JsonConvert.DeserializeObject <TrackResultModel>(result); _viewModel.TrackList = data.playlist; }); }
public void StartMusicDetailPanel(MusicBean music) { ListContent.Visibility = Visibility.Collapsed; DetailContent.Visibility = Visibility.Visible; AppBarBack.Visibility = Visibility.Visible; AppBarMenu.Visibility = Visibility.Collapsed; AppBarTitle.Visibility = Visibility.Collapsed; DetailTitle.Text = music.title; var imageSource = ImageHelper.LoadImageSource(music.CoverPath, "Assert/cover.jpg"); DetailHeaderBackground.Source = imageSource; DetailCoverImage.Source = imageSource; LoadTrackList(music); }