using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
using StartServerWPF.Modules.Main.ViewModels;
using StartServerWPF.Modules.Main.Views;

namespace StartServerWPF.Modules.Main
{
    public class MainModule : IModule
    {
        public void OnInitialized(IContainerProvider containerProvider)
        {
           var  iRegion=  containerProvider.Resolve<IRegionManager>();
            iRegion.RegisterViewWithRegion("MainContentRegion", typeof(MainView));
            iRegion.RegisterViewWithRegion("LeftMenuTreeRegion", typeof(TreeMenuView));
        }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<MainView>();
            containerRegistry.RegisterForNavigation<RealTimeWaveformView>();
            containerRegistry.RegisterForNavigation<WaveformPlayBackView>();
            containerRegistry.RegisterForNavigation<SetParamView>();
            containerRegistry.RegisterForNavigation<DataProcessView>();        
            containerRegistry.RegisterForNavigation<LogManagementView>();
            containerRegistry.RegisterForNavigation<FilesWatcherView>();

            containerRegistry.RegisterDialog<AddWorkAreaDialog>();
            containerRegistry.RegisterDialog<LoginViewDialog>();
            
            containerRegistry.RegisterSingleton<MainViewModel>();
            containerRegistry.RegisterSingleton<LoginViewDialogViewModel>();


        }
    }
}