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.
ShopNCook/Views/MyListPage.xaml.cs

27 lines
792 B

using Endpoint;
using LocalEndpoint;
using Models;
using ShoopNCook.Views;
namespace ShoopNCook.Pages;
public partial class MyListPage : ContentPage
{
public MyListPage(Account account, IRecipesService service)
{
InitializeComponent();
IAccountRecipes recipes = service.GetRecipesOf(account);
recipes.GetWeeklyList().ForEach(tuple =>
{
RecipeInfo info = tuple.Item1;
RecipesLayout.Children.Add(new StoredRecipeView(info, tuple.Item2, amount =>
{
Recipe recipe = service.GetRecipe(info);
AccountRecipeRate? rate = recipes.FindRate(info);
Shell.Current.Navigation.PushAsync(new RecipePage(recipe, rate, amount));
}));
});
}
}