Region(string regionName, IViewModelLocator viewModelLocator, IViewLocator viewLocator, IStateSerializer stateSerializer)
 {
     LogicalSerializationMode = LogicalSerializationMode.Enabled;
     this.RegionName          = regionName;
     this.viewModelLocator    = viewModelLocator;
     this.viewLocator         = viewLocator;
     this.stateSerializer     = stateSerializer;
     this.serviceManager      = new WeakReferenceManager <IUIRegion>();
     this.items = new List <RegionItem>();
 }
Exemple #2
0
        public Region(string regionName, IModuleManagerImplementation owner, bool isTestingMode)
        {
            LogicalSerializationMode = LogicalSerializationMode.Enabled;
            this.RegionName          = regionName;
            this.owner          = owner;
            this.serviceManager = new WeakReferenceManager <IUIRegion>();
            this.items          = new List <RegionItem>();

            if (isTestingMode)
            {
                RegisterUIRegion(new TestUIRegion(regionName, owner));
            }
            else
            {
                var services = ServiceContainer.Default.GetServices <IUIRegion>().Where(x => x.RegionName == regionName);
                foreach (var service in services)
                {
                    RegisterUIRegion(service);
                }
            }
        }