private void ShowFav() { ClearUsers(); var favoritedUsers = FavoriteUserManager.GetFavoriteUsersAsync().Result; foreach (var u in favoritedUsers) { Results.Add(new Result { name = new Name { first = u.Name, last = u.LastName }, email = u.Email, location = JsonConvert.DeserializeObject <Location>(u.Address), dob = new Dob { date = u.Date }, picture = new Picture { large = u.ImgSource, thumbnail = u.Thumbnail }, favorite = true, FavUser = u }); } OnPropertyChanged(nameof(Results)); }
private void unfavoriteUser() { if (favoritedUser != null) { FavoriteUserManager.DeleteFavoriteUserAsync(favoritedUser); favoritedUser = null; } else { FavoriteUserManager.DeleteFavoriteUserAsync(favoritedUser); } notFav = true; FavoriteBehaviour(); }
private void FavButton() { favoritedUser = new FavoriteUser() { ID = 0, Name = User.name.first, LastName = User.name.last, Email = User.email, Address = JsonConvert.SerializeObject(User.location), Date = User.dob.date, ImgSource = User.picture.large, Thumbnail = User.picture.thumbnail }; FavoriteUserManager.SaveFavoriteUserAsync(favoritedUser); notFav = false; FavoriteBehaviour(); }
private void clearDB() { FavoriteUserManager.DeleteFavoriteUsersAsync(); }