/// <summary> /// Toggles the favourited state of the given property. /// </summary> public void SetPropertyFavourited(Property property, bool isFavourited) { if (!isFavourited && IsPropertyFavourited(property)) { var matchingProperty = Favourites.Single(p => p.Guid == property.Guid); Favourites.Remove(matchingProperty); } else if (isFavourited && !IsPropertyFavourited(property)) { Favourites.Add(property); } PersistState(); }
/// <summary> /// Toggles the favourited state of the given property. /// </summary> public void ToggleFavourite(Property property) { if (IsPropertyFavourited(property)) { var matchingProperty = Favourites.Single(p => p.Guid == property.Guid); Favourites.Remove(matchingProperty); } else { Favourites.Add(property); } PersistState(); }