Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
        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);
        }