public MainWindowViewModel(IRegionManager regionManager, IRegionsProvider regionsProvider)
        {
            this.regionManager   = regionManager;
            this.regionsProvider = regionsProvider;


            this.regions = new ObservableCollection <NavigableRegion>(this.regionsProvider.Regions.Values.Where((r) => r.AvailableForUser));

            this.selectedRegion = this.regionsProvider.SelectedRegion;
        }
        private void Register(NavigableRegion region)
        {
            var regionManager = this.Container.Resolve <IRegionManager>();

            var mainRegion = regionManager.Regions[RegionNames.Main];

            if (mainRegion.Name == region.Id)
            {
                return;
            }


            regionManager.RegisterViewWithRegion(region.Id, () =>
                                                 this.Container.Resolve(region.Type));

            object view = this.Container.Resolve(region.Type);

            mainRegion.Add(view);
        }