using Model.Serialization;
using Model.Stub;

namespace Linaris;

public partial class App : Application
{
    public Manager Manager = new(new LinqXmlSerialization());

    public App()
    {
        InitializeComponent();
        MainPage = new AppShell();
    }

    protected override Window CreateWindow(IActivationState activationState)
    {
        var Window = base.CreateWindow(activationState);

        Window.Stopped += (sender, eventArgs) => {
            Manager.SaveSerialization();
        };

        const int newHeight = 900;
        const int newWidth = 1800;
        const int minHeight = 800;
        const int minWidth = 400;

        Window.X = 0;
        Window.Y = 100;

        Window.Width = newWidth;
        Window.Height = newHeight;

        Window.MinimumHeight = minHeight;
        Window.MinimumWidth = minWidth;

        return Window;
    }
}
