#if WINDOWS using Microsoft.UI; using Microsoft.UI.Windowing; using Windows.Graphics; #endif using DataPersistence; using Model; using System.Collections.ObjectModel; using Model.Managers; using Microsoft.Maui.Controls; using System.Linq; using System.ComponentModel; using System.Runtime.CompilerServices; using FakePersistance; namespace Views { public partial class App : Application { private Recipe currentRecipe { get; set; } /// /// Master manager - access to the Model. /// public MasterManager MasterMgr { get; private set; } = new MasterManager(new Stubs()); /// /// Current selected recipe. /// public Recipe CurrentRecipe { get => currentRecipe; set { currentRecipe = value; OnPropertyChanged(nameof(CurrentRecipe)); } } /// /// Get the current connected user. /// public User? CurrentUser { get; private set; } /// /// Get all the recipes loaded. /// public RecipeCollection AllRecipes { get; set; } public App() { CurrentUser = MasterMgr.CurrentConnectedUser; AllRecipes = MasterMgr.DataMgr.GetRecipes("All recipes"); CurrentRecipe = MasterMgr.DataMgr.GetRecipes().First(); InitializeComponent(); UserAppTheme = AppTheme.Light; MainPage = new Home(); } } }