|
|
|
@ -13,43 +13,31 @@ namespace Views
|
|
|
|
|
{
|
|
|
|
|
public partial class App : Application
|
|
|
|
|
{
|
|
|
|
|
//Point d'entrée de l'application
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Master manager - access to the Model.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public MasterManager MasterMgr { get; private set; } = new MasterManager(new Stubs());
|
|
|
|
|
|
|
|
|
|
//L'utilisateur courant de l'application
|
|
|
|
|
public User CurrentUser { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get the current connected user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public User? CurrentUser { get; private set; }
|
|
|
|
|
|
|
|
|
|
//collection de recette de l'application
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get all the recipes loaded.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public RecipeCollection AllRecipes { get; set; }
|
|
|
|
|
|
|
|
|
|
//const int WindowWidth = 1200;
|
|
|
|
|
//const int WindowHeight = 800;
|
|
|
|
|
|
|
|
|
|
public App()
|
|
|
|
|
{
|
|
|
|
|
CurrentUser = MasterMgr.DataMgr.GetUsers().Last();
|
|
|
|
|
CurrentUser = MasterMgr.CurrentConnectedUser;
|
|
|
|
|
AllRecipes = MasterMgr.DataMgr.GetRecipes("All recipes");
|
|
|
|
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
/*
|
|
|
|
|
Microsoft.Maui.Handlers.WindowHandler.Mapper.AppendToMapping(nameof(IWindow), (handler, view) =>
|
|
|
|
|
{
|
|
|
|
|
#if WINDOWS
|
|
|
|
|
var mauiWindow = handler.VirtualView;
|
|
|
|
|
var nativeWindow = handler.PlatformView;
|
|
|
|
|
nativeWindow.Activate();
|
|
|
|
|
IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(nativeWindow);
|
|
|
|
|
WindowId windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(windowHandle);
|
|
|
|
|
AppWindow appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId);
|
|
|
|
|
appWindow.Resize(new SizeInt32(WindowWidth, WindowHeight));
|
|
|
|
|
#endif
|
|
|
|
|
});
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* - Comment(ctrl-k + ctrl-c)/Uncomment(ctrl-k + ctrl-u) to change page - */
|
|
|
|
|
UserAppTheme = AppTheme.Light;
|
|
|
|
|
MainPage = new Home();
|
|
|
|
|
//MainPage = new MyPosts();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|