using GreadyPoang.DataLayer.Database;

namespace GreadyPoang;

public partial class App : Application
{
    private readonly IServiceProvider _services;

    public App(IServiceProvider services, DataContext dataContext)
    {
        InitializeComponent();
        dataContext.Database.EnsureCreated();
        _services = services;
    }

    protected override Window CreateWindow(IActivationState? activationState)
    {

        //var splashVm = ServiceLocator.Services.GetRequiredService<SplashViewModelCommands>();
        //var shell = new AppShell(splashVm);

        var shell = _services.GetRequiredService<AppShell>();
        return new Window(shell);
    }
}