protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); //将传过来的数据 类型转换一下 commentRoot = (CommentRoot)e.Parameter; ListBox_HotComment.ItemsSource = commentRoot.hotComments == null ? null : commentRoot.hotComments; ListBox_allComment.ItemsSource = commentRoot.comments == null ? null : commentRoot.comments; }
private async void Button_comment_Click(object sender, RoutedEventArgs e) { ProgressBar_loading.Visibility = Visibility.Visible; CommentRoot commentRoot = await Task.Run(() => CommentService.GetAlbumComment(albumRoot.album.id)); ProgressBar_loading.Visibility = Visibility.Collapsed; if (commentRoot == null) { return; } Frame.Navigate(typeof(Comment), commentRoot); }
async void UpDateRadioComment(long id) { ProgressBar_loadComment.Visibility = Visibility.Visible; CommentRoot commentRoot = await Task.Run(() => CommentService.GetRadioComment(id)); if (commentRoot == null) { ProgressBar_loadComment.Visibility = Visibility.Collapsed; ListBox_HotComment.ItemsSource = null; ListBox_allComment.ItemsSource = null; TextBlock_commentCount.Text = ""; return; } ListBox_HotComment.ItemsSource = commentRoot.hotComments; ListBox_allComment.ItemsSource = commentRoot.comments; TextBlock_commentCount.Text = commentRoot.total.ToString(); ScrollViewer_comment.ChangeView(null, 0, null); ProgressBar_loadComment.Visibility = Visibility.Collapsed; }
private async void Button_comment_Click(object sender, RoutedEventArgs e) { //var dialog = new ContentDialog(); //Comment comment = new Comment(playListDetailRoot.playlist.id); //dialog.Content = comment; //await dialog.ShowAsync(); //ProgressBar_loadingComment.Visibility = Visibility.Visible; //CommentRoot commentRoot = await Task.Run(() => MyClassManager.GetPlayListComment(playListDetailRoot.playlist.id)); //ProgressBar_loadingComment.Visibility = Visibility.Collapsed; //ListBox_HotComment.ItemsSource = commentRoot.hotComments == null ? null : commentRoot.hotComments; //ListBox_allComment.ItemsSource = commentRoot.topComments == null ? null : commentRoot.comments; ProgressBar_loading.Visibility = Visibility.Visible; CommentRoot commentRoot = await Task.Run(() => CommentService.GetPlaylistComment(playListDetailRoot.playlist.id)); ProgressBar_loading.Visibility = Visibility.Collapsed; if (commentRoot == null) { return; } Frame.Navigate(typeof(Comment), commentRoot); }