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.
Projet_IHM/Sources/Stim/App.xaml.cs

32 lines
1.0 KiB

using Model;
using StimPersistance;
using StimStub;
namespace Stim;
public partial class App : Application
{
public Manager Manager { get; set; }
public App()
{
InitializeComponent();
//Faut changer le boot sur LoginPage plus tard, j'ai mit create là pour pouvoir use l'appli, ce référer au comment sur create et loginpage.
MainPage = new Create();
if (File.Exists(Path.Combine(FileSystem.Current.AppDataDirectory, "games.xml"))) Manager = new Manager(new Persistance(FileSystem.Current.AppDataDirectory));
else Manager = new(new Stub());
}
protected override Window CreateWindow(IActivationState activationState)
{
Window window = base.CreateWindow(activationState);
window.Stopped += (s, e) =>
{
Manager.Mgrpersistance = new Persistance(FileSystem.Current.AppDataDirectory);
Manager.SaveGames();
Manager.SaveUser();
};
return window;
}
}