Пример #1
0
        /// <summary>
        /// Asynchronously refreshes the posts. It calls the repository get posts method in order to refill the
        /// <see cref="Posts"/> collection.
        /// </summary>
        internal async Task RefreshPostsAsync()
        {
            var posts = await repository.GetPostsAsync(id);

            await UIUtils.InvokeFromUIThread(() =>
            {
                Posts.Clear();
                foreach (var p in posts)
                {
                    Posts.Add(new PostViewModel
                    {
                        Title   = p.Title,
                        Content = p.Content
                    });
                }
            });
        }