Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        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 { }
        }
Esempio n. 3
0
        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);
                }
            }
        }
Esempio n. 4
0
 public override void OnDeactivated()
 {
     Shelves.DisposeAll();
     Shelves.Clear();
     Shelves = null;
 }