using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Txgy.EWS.Client.Common;
using Txgy.EWS.Client.PageModule.Models;
using Txgy.EWS.Client.PageModule.Views;

namespace Txgy.EWS.Client.PageModule
{
    public class PageModuleProfile : IModule
    {
       
        public void OnInitialized(IContainerProvider containerProvider)
        {
            //CadLineList.LineProperties = CadLineList.ReadDwgFromJson(dwgJsonPath);
            var regionManager = containerProvider.Resolve<IRegionManager>();
            //regionManager.RegisterViewWithRegion("PlaneViewEventListContentRegion", typeof(EventListView));
            //regionManager.RegisterViewWithRegion("StereoEventListContentRegion", typeof(EventListView));
            regionManager.RequestNavigate("MainContentRegion", "EarlyWarningView");
            regionManager.RegisterViewWithRegion("TitleRegion", typeof(TitleView));

            //regionManager.AddToRegion("StereoEventListContentRegion", containerProvider.Resolve<EventListView>());
            //var plRegion=regionManager.Regions["PlaneViewEventListContentRegion"];
            //plRegion.Add(containerProvider.Resolve<EventListView>());
            //var stRegion = regionManager.Regions["StereoEventListContentRegion"];
            //stRegion.Add(containerProvider.Resolve<EventListView>());
            
        }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            //containerRegistry.RegisterForNavigation<TitleView>();
            containerRegistry.RegisterForNavigation<EarlyWarningView>();
            containerRegistry.RegisterForNavigation<PlanView>();
            containerRegistry.RegisterForNavigation<StereogramView>();
            containerRegistry.RegisterForNavigation<FocalMechanismView>();
            containerRegistry.RegisterForNavigation<SettingView>();
            containerRegistry.RegisterForNavigation<WaveformView>();            
            containerRegistry.RegisterForNavigation<EventStatView>();
            containerRegistry.RegisterForNavigation<ReportView>();

            containerRegistry.RegisterSingleton<EventListView>();
            //containerRegistry.registert
            //containerRegistry.Register<EventListView>();
            //containerRegistry.re
            //containerRegistry.RegisterSingleton<ReportContentView>();
            //containerRegistry.RegisterSingleton<ReportDayListView>();
            //containerRegistry.RegisterDialog<AddUserDialog>();
            //containerRegistry.RegisterDialog<ModifyRolesDialog>();
            //containerRegistry.RegisterDialog<AddRoleDialog>();
            //containerRegistry.RegisterDialog<SelectUserDialog>();
        }
    }
}
