|
|
@ -8,6 +8,10 @@ using DataPersistence;
|
|
|
|
using Model;
|
|
|
|
using Model;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using Model.Managers;
|
|
|
|
using Model.Managers;
|
|
|
|
|
|
|
|
using Microsoft.Maui.Controls;
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Views
|
|
|
|
namespace Views
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -15,9 +19,21 @@ namespace Views
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Point d'entrée de l'application
|
|
|
|
//Point d'entrée de l'application
|
|
|
|
public MasterManager MasterMgr { get; private set; } = new MasterManager(new Stubs());
|
|
|
|
public MasterManager MasterMgr { get; private set; } = new MasterManager(new Stubs());
|
|
|
|
|
|
|
|
|
|
|
|
//L'utilisateur courant de l'application
|
|
|
|
//L'utilisateur courant de l'application
|
|
|
|
public User CurrentUser { get; set; }
|
|
|
|
public User CurrentUser { get; set; }
|
|
|
|
|
|
|
|
private Recipe currentRecipe { get; set; }
|
|
|
|
|
|
|
|
public Recipe CurrentRecipe
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => currentRecipe;
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
currentRecipe = value;
|
|
|
|
|
|
|
|
OnPropertyChanged(nameof(CurrentRecipe));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//collection de recette de l'application
|
|
|
|
//collection de recette de l'application
|
|
|
|
public RecipeCollection AllRecipes { get; set; }
|
|
|
|
public RecipeCollection AllRecipes { get; set; }
|
|
|
@ -29,7 +45,7 @@ namespace Views
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CurrentUser = MasterMgr.DataMgr.GetUsers().Last();
|
|
|
|
CurrentUser = MasterMgr.DataMgr.GetUsers().Last();
|
|
|
|
AllRecipes = MasterMgr.DataMgr.GetRecipes("All recipes");
|
|
|
|
AllRecipes = MasterMgr.DataMgr.GetRecipes("All recipes");
|
|
|
|
|
|
|
|
CurrentRecipe = MasterMgr.DataMgr.GetRecipes().First();
|
|
|
|
InitializeComponent();
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
|
|
// Microsoft.Maui.Handlers.WindowHandler.Mapper.AppendToMapping(nameof(IWindow), (handler, view) =>
|
|
|
|
// Microsoft.Maui.Handlers.WindowHandler.Mapper.AppendToMapping(nameof(IWindow), (handler, view) =>
|
|
|
@ -51,5 +67,6 @@ namespace Views
|
|
|
|
MainPage = new Home();
|
|
|
|
MainPage = new Home();
|
|
|
|
//MainPage = new MyPosts();
|
|
|
|
//MainPage = new MyPosts();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|