예제 #1
0
 protected MvvmApplication(LoadMode?moduleLoadMode = null, IList <IModule> modules = null, Action <IModuleContext> loadModulesDelegate = null)
 {
     if (ToolkitServiceProvider.UiSynchronizationContextField == null)
     {
         ToolkitServiceProvider.UiSynchronizationContextField = SynchronizationContext.Current;
     }
     _moduleLoadMode      = moduleLoadMode;
     _applicationState    = ApplicationState.Active;
     _platform            = PlatformInfo.Unknown;
     _context             = new DataContext();
     _loadModulesDelegate = loadModulesDelegate;
     if (!modules.IsNullOrEmpty())
     {
         Modules = modules;
     }
     ToolkitServiceProvider.Initialize(this);
 }
예제 #2
0
 public void Initialize(PlatformInfo platformInfo, IIocContainer iocContainer, IList <Assembly> assemblies, IDataContext context)
 {
     Should.NotBeNull(platformInfo, nameof(platformInfo));
     Should.NotBeNull(iocContainer, nameof(iocContainer));
     Should.NotBeNull(assemblies, nameof(assemblies));
     if (_isInitialized)
     {
         return;
     }
     _isInitialized = true;
     _platform      = platformInfo;
     _iocContainer  = iocContainer;
     if (context != null)
     {
         Context.Merge(context);
     }
     _iocContainer.BindToConstant <IMvvmApplication>(this);
     OnInitialize(assemblies);
     ToolkitServiceProvider.Initialize(this);
 }