using Models; namespace ShoopNCook.Pages; using Endpoint; using Models; using ShoopNCook.Views; public partial class FavoritesPage : ContentPage { public FavoritesPage(Account account, IRecipesService service) { InitializeComponent(); //TODO this code can be factorised (see HomePage, MyListPage) service.LookupFavoritesOf(account).ForEach(info => { RecipeViewLayout.Children.Add(new RecipeView(info, () => { Recipe recipe = service.GetRecipe(info); AccountRecipeRate rate = service.GetRateOf(account, recipe); Shell.Current.Navigation.PushAsync(new RecipePage(recipe, rate, 1)); })); }); } }