コード例 #1
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     var aggCatalog = new AggregateCatalog();
     aggCatalog.Catalogs.Add(new DeploymentCatalog());
     var genericCatalog = new GenericCatalog(aggCatalog, new RepositoryRegistry());
     CompositionHost.Initialize(genericCatalog);
     CompositionInitializer.SatisfyImports(this);
     this.RootVisual = MainPage;
     Messenger.Default.Register<GenericMessage<ProjectViewModel>>(this, HandleChange);
 }
コード例 #2
0
ファイル: GenericsDemo.cs プロジェクト: pwlodek/CodeGallery
        private static CompositionContainer CreateContainer2()
        {
            // Create source catalog
            var typeCatalog = new TypeCatalog(typeof(Trampoline));

            // Create catalog which supports open-generics, pass in the registry
            var genericCatalog = new GenericCatalog(new MyGenericContractRegistry());

            // Aggregate the both catalogs
            var aggregateCatalog = new AggregateCatalog(typeCatalog, genericCatalog);

            // Create the container
            return new CompositionContainer(aggregateCatalog);
        }