public async Task <List <PostData> > GetPosts(PostRequest filter) { var response = await PostAPI.GetAllPosts(filter, AppPersistent.UserToken); if (response.error) { return(new List <PostData>()); } return(response.data); }
async Task <bool> UpdatePosts(PostRequest filters) { postsPanel.Items.Clear(); var postsResponse = await PostAPI.GetAllPosts(filters, AppPersistent.UserToken); if (postsResponse == null) { return(false); } foreach (var post in postsResponse.data) { PostWidget widget = new PostWidget() { PostText = post.text, ImageURL = post.attachments[0].photo.photo_medium, CurrentPostData = post }; postsPanel.Items.Add(widget); } return(true); }