private void ToggleFavorite() { if (!IsSavedGallery) { return; } Favorite = !Favorite; if (Favorite) { if (!FavoritesController.FavoriteMd5s.Contains(Md5)) { FavoritesController.Favorites.Insert(0, this); } } else { FavoritesController.Favorites.RemoveAll(f => f.Md5 == Md5 || f.Link == Link); } FavoritesController.Save(); }