async void UpdateComments(int id) { var commentsData = await PostAPI.GetCommentsForPost(id); if (commentsData.data.Count == 0) { return; } lstComments.Items.Clear(); for (int i = commentsData.data.Count - 1; i > -1; --i) { UserComment commentWidget = new UserComment(); commentWidget.UserName = commentsData.data[i].user.name; commentWidget.Comment = commentsData.data[i].text; commentWidget.ImageURL = commentsData.data[i].user.photo; commentWidget.UserID = commentsData.data[i].user.id; commentWidget.CommentID = commentsData.data[i].id; lstComments.Items.Add(commentWidget); } }
private void CopyUserId_Click(object sender, RoutedEventArgs e) { UserComment comment = (UserComment)lstComments.SelectedItem; Clipboard.SetText(comment.UserID.ToString()); }