public async void init(Request r) { RedditSession reddit = new RedditSession(); List <Post> posts = await reddit.getPosts(r); foreach (var post in posts) { var np = new PostViewModel(post); Posts.Add(np); } }
public async void init(String permalink, String commentId) { RedditSession reddit = new RedditSession(); List <RedditComment> comments = await reddit.getComments(permalink, commentId); foreach (var comment in comments) { var np = new CommentViewModel(comment); np.replies = new List <CommentViewModel>(); foreach (var reply in comment.replies) { np.replies.Add(NestReplies(reply)); } _Comments.Add(np); } }