/// <summary>Asynchronously gets all the blogs.</summary>
        public async Task GetBlogsAsync()
        {
            var blogs = await repository.GetBlogsAsync();

            // Fill the blogs collection should be from the thread that created the collection.
            await UIUtils.InvokeFromUIThread(() =>
            {
                Blogs.Clear();
                foreach (var b in blogs)
                {
                    Blogs.Add(new BlogViewModel(repository)
                    {
                        Name = b.Name,
                        Id   = b.Id
                    });
                }
            });
        }
Example #2
0
        public async Task GetBlogs()
        {
            await AuthenticateAsync();

            var list = await _service.Blogs.ListByUser("self").ExecuteAsync();

            Blogs.Clear();
            if (list.Items == null)
            {
                return;
            }

            var blogs = from blog in list.Items
                        select new Blog
                        {
                            Id = blog.Id,
                            Name = blog.Name
                        };

            foreach (var blog in blogs)
            {
                Blogs.Add(blog);
            }
        }
Example #3
0
 public void ClearAssignments()
 {
     PreviousBlogs = Blogs.Select(x => x.Name).ToList();
     Blogs.Clear();
 }