using Payesh.App.ViewModels;
using Payesh.App.ViewModels.Pages;
using Payesh.App.Views;
using Payesh.App.Views.Pages;
using Prism;
using Prism.Ioc;
using Xamarin.Essentials.Implementation;
using Xamarin.Essentials.Interfaces;
using Xamarin.Forms;

namespace Payesh.App
{
    public partial class App
    {
        public App(IPlatformInitializer initializer)
            : base(initializer)
        {
        }

        protected override async void OnInitialized()
        {
            InitializeComponent();

            Sharpnado.MaterialFrame.Initializer.Initialize(false,false);
            Sharpnado.Tabs.Initializer.Initialize(false, false);
            Sharpnado.Shades.Initializer.Initialize(loggerEnable: false);

            await NavigationService.NavigateAsync("NavigationPage/MainPage");
        }

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterSingleton<IAppInfo, AppInfoImplementation>();

            containerRegistry.RegisterForNavigation<NavigationPage>();
            containerRegistry.RegisterForNavigation<MainPage, MainPageViewModel>();
            containerRegistry.RegisterForNavigation<FactoriesMonitorPage, FactoriesMonitorPageViewModel>();
            containerRegistry.RegisterForNavigation<FactoryMonitorPage, FactoryMonitorPageViewModel>();
        }
    }
}
