protected override void Configure() { var catalog = MefHelper.SafeDirectoryCatalog(AppDomain.CurrentDomain.BaseDirectory); AssemblySource.Instance.Select(x => new AssemblyCatalog(x)) .OfType <ComposablePartCatalog>() .ToList().ForEach((c) => { catalog.Catalogs.Add(c); }); GlobalData.MefContainer = new CompositionContainer(catalog); // GlobalData.MefContainer = new CompositionContainer(catalog,CompositionOptions.DisableSilentRejection);//// container = CompositionHost.Initialize(catalog); var batch = new CompositionBatch(); batch.AddExportedValue <IWindowManager>(new WindowManager()); batch.AddExportedValue <IEventAggregator>(new EventAggregator()); //batch.AddExportedValue<IWindowManager>(new ScreenLifetimeManagerViewModel()); //batch.AddExportedValue<IEventAggregator>(new WebBoxViewModel()); batch.AddExportedValue(GlobalData.MefContainer); ////batch.AddExportedValue(container); ////batch.AddExportedValue(catalog); //this.Container.ComposeParts(this); GlobalData.MefContainer.Compose(batch);//// container.Compose(batch); //EFLogger.EFLogger.Init(); Coroutine.Completed += (s, e) => { if (e.Error != null) { MessageBox.Show(e.Error.Message); } }; }
protected override void Configure() { var catalog = MefHelper.SafeDirectoryCatalog(AppDomain.CurrentDomain.BaseDirectory); AssemblySource.Instance.Select(x => new AssemblyCatalog(x)) .OfType <ComposablePartCatalog>() .ToList().ForEach((c) => { catalog.Catalogs.Add(c); }); GlobalData.MefContainer = new CompositionContainer(catalog, CompositionOptions.DisableSilentRejection); var batch = new CompositionBatch(); batch.AddExportedValue <IWindowManager>(new WindowManager()); batch.AddExportedValue <IEventAggregator>(new EventAggregator()); batch.AddExportedValue(GlobalData.MefContainer); //this.Container.ComposeParts(this); GlobalData.MefContainer.Compose(batch); EFLogger.EFLogger.Init(); }