public override async void OnNavigatingTo(NavigationParameters parameters) { base.OnNavigatingTo(parameters); var shelf = await WebClient.Client.ListShelvesAsync(); ObservableCollection <string> temp = new ObservableCollection <string>(shelf); Shelves.Clear(); foreach (string s in temp) { Shelves.Add(s); } }
private void PopulateData(User friend) { Id = friend.Id; Name = friend.Name; ImageUrl = friend.ImageUrl; Link = friend.Link; Age = friend.Age; About = friend.About; Gender = friend.Gender; Location = friend.Location; Website = friend.Website; Joined = friend.Joined; LastActive = friend.LastActive; Interests = friend.Interests; FavouriteBooks = friend.FavoriteBooks; FriendsCount = $"{friend.FriendsCount} Friends"; BooksCount = $"{friend.ReviewsCount} Books"; GroupsCount = $"{friend.GroupsCount} Groups"; //Task.Run( async () => try { CurrentlyReading.Clear(); if (friend.UserStatuses != null && friend.UserStatuses.Count > 0) { foreach (var userStatus in friend.UserStatuses) CurrentlyReading.Add(new UserStatusViewModel(userStatus)); } Updates.Clear(); if (friend.Updates != null && friend.Updates.Update != null && friend.Updates.Update.Count > 0) { foreach (var userUpdate in friend.Updates.Update) Updates.Add(new UpdateViewModel(userUpdate)); } Shelves.Clear(); if (friend.UserShelves != null && friend.UserShelves.Count > 0) { foreach (var shelf in friend.UserShelves) Shelves.Add(new ShelfViewModel(shelf)); } }//); catch { } }
private async void Add() { if (NewShelf.Trim() != "") { await WebClient.Client.AddNewShelf(NewShelf); NewShelf = ""; var shelf = await WebClient.Client.ListShelvesAsync(); ObservableCollection <string> temp = new ObservableCollection <string>(shelf); Shelves.Clear(); foreach (string s in temp) { Shelves.Add(s); } } }
public override void OnDeactivated() { Shelves.DisposeAll(); Shelves.Clear(); Shelves = null; }