|
|
@ -7,11 +7,25 @@ namespace ShoopNCook.Pages;
|
|
|
|
|
|
|
|
|
|
|
|
public partial class MyListPage : ContentPage
|
|
|
|
public partial class MyListPage : ContentPage
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private readonly IAccountRecipesPreferences preferences;
|
|
|
|
|
|
|
|
private readonly IUserNotifier notifier;
|
|
|
|
|
|
|
|
private readonly IRecipesService service;
|
|
|
|
|
|
|
|
|
|
|
|
public MyListPage(Account account, IUserNotifier notifier, IRecipesService service)
|
|
|
|
public MyListPage(Account account, IUserNotifier notifier, IRecipesService service)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
|
|
IAccountRecipesPreferences preferences = service.GetPreferencesOf(account);
|
|
|
|
this.preferences = service.GetPreferencesOf(account);
|
|
|
|
|
|
|
|
this.notifier = notifier;
|
|
|
|
|
|
|
|
this.service = service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UpdateMyList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void UpdateMyList()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
RecipesLayout.Children.Clear();
|
|
|
|
preferences.GetWeeklyList().ForEach(tuple =>
|
|
|
|
preferences.GetWeeklyList().ForEach(tuple =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
RecipeInfo info = tuple.Item1;
|
|
|
|
RecipeInfo info = tuple.Item1;
|
|
|
@ -21,6 +35,10 @@ public partial class MyListPage : ContentPage
|
|
|
|
Shell.Current.Navigation.PushAsync(new RecipePage(recipe, notifier, preferences, amount));
|
|
|
|
Shell.Current.Navigation.PushAsync(new RecipePage(recipe, notifier, preferences, amount));
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void ContentPage_NavigatedTo(object sender, NavigatedToEventArgs e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
UpdateMyList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|