You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
759 B
29 lines
759 B
using Models;
|
|
|
|
namespace ShoopNCook.Pages;
|
|
|
|
using Endpoint;
|
|
using LocalEndpoint;
|
|
using Models;
|
|
using ShoopNCook.Views;
|
|
|
|
public partial class FavoritesPage : ContentPage
|
|
{
|
|
public FavoritesPage(Account account, IRecipesService service)
|
|
{
|
|
InitializeComponent();
|
|
|
|
IAccountRecipes recipes = service.GetRecipesOf(account);
|
|
recipes.GetFavorites().ForEach(info =>
|
|
{
|
|
RecipeViewLayout.Children.Add(new RecipeView(info, () =>
|
|
{
|
|
Recipe recipe = service.GetRecipe(info);
|
|
AccountRecipeRate? rate = recipes.FindRate(info);
|
|
Shell.Current.Navigation.PushAsync(new RecipePage(recipe, rate, 1));
|
|
}));
|
|
});
|
|
|
|
}
|
|
|
|
} |