/// <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 }); } }); }
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); } }
public void ClearAssignments() { PreviousBlogs = Blogs.Select(x => x.Name).ToList(); Blogs.Clear(); }