예제 #1
0
        protected override IModuleCatalog CreateModuleCatalog()
        {
            using Stream xamlStream = File.OpenRead("Configuration/ModuleCatalog.xaml");
            var moduleCatalog = ModuleCatalog.CreateFromXaml(xamlStream);

            return(moduleCatalog);
        }
예제 #2
0
 protected override IModuleCatalog CreateModuleCatalog()
 {
     // ModuleCatalog.xaml属性中需要编辑为资源
     // ModuleA.dll需要拷贝到当前运行路径下
     System.Uri uri = new System.Uri("pack://application:,,,/ModulesWithXaml;component/ModuleCatalog.xaml", System.UriKind.RelativeOrAbsolute);
     return(ModuleCatalog.CreateFromXaml(uri));
 }
예제 #3
0
        protected override IModuleCatalog CreateModuleCatalog()
        {
            // Конфигурация модуля описана в файле XamlCatalog.xaml.
            // На модуль reference не требуется. dll модуля кладется в нужную директорию.
            var uri = new Uri("/PrismDemo;component/XamlCatalog.xaml", UriKind.Relative);

            return(ModuleCatalog.CreateFromXaml(uri));
        }
예제 #4
0
        /// <summary>
        /// Returns the module catalog that will be used to initialize the modules.
        /// </summary>
        /// <returns>An instance of <seealso cref="IModuleCatalog" /> that will be used to initialize the modules.</returns>
        protected override IModuleCatalog GetModuleCatalog()
        {
            IConfigurationService configurationService = this.Container.Resolve <IConfigurationService>();

            string moduleCatalog = configurationService.GetParameterValue("ModulesCatalog");

            Uri            moduleCatelogUri = new Uri(moduleCatalog, UriKind.Relative);
            IModuleCatalog catalog          = ModuleCatalog.CreateFromXaml(moduleCatelogUri);

            return(catalog);
        }
예제 #5
0
        public void CanLoadCatalogFromXaml()
        {
            Stream stream =
                Assembly.GetExecutingAssembly().GetManifestResourceStream(
                    "Prism.Avalonia.Tests.Modularity.ModuleCatalogXaml.SimpleModuleCatalog.xaml");

            var catalog = ModuleCatalog.CreateFromXaml(stream);

            Assert.IsNotNull(catalog);

            Assert.AreEqual(4, catalog.Modules.Count());
        }
예제 #6
0
        protected override IModuleCatalog GetModuleCatalog()
        {
            IConfigurationService configurationService = this.Container.Resolve <IConfigurationService>();

            string         moduleCatalog    = configurationService.GetParameterValue("ModulesCatalog");
            Uri            moduleCatelogUri = new Uri(moduleCatalog, UriKind.Relative);
            IModuleCatalog catalog          = ModuleCatalog.CreateFromXaml(moduleCatelogUri);

            return(catalog);
            //return ModuleCatalog.CreateFromXaml(new Uri("/IndoorWorx.Silverlight;component/ModulesCatalog.xaml", UriKind.Relative));
            //return ModuleCatalog.CreateFromXaml(new Uri(PrismResources.ModulesCatalogLocation, UriKind.Relative));
        }
예제 #7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var container = new UnityContainer();

            container.RegisterInstance(Current);
            container.RegisterInstance <IServiceLocator>(new UnityServiceLocator(container));
            container.RegisterInstance <ILoggerFacade>(new EmptyLogger());
            container.RegisterInstance <IModuleCatalog>(
                ModuleCatalog.CreateFromXaml(new Uri("ModuleCatalog.xaml", UriKind.Relative)));

            container.RegisterType <IModuleInitializer, ModuleInitializer>();
            container.RegisterType <IModuleManager, ModuleManager>();

            var moduleManager = container.Resolve <IModuleManager>();

            moduleManager.Run();
        }
예제 #8
0
 protected override IModuleCatalog GetModuleCatalog()
 {
     return(ModuleCatalog.CreateFromXaml(
                new Uri("/Prism.Shell;component/ModuleCatalog.xaml",
                        UriKind.Relative)));
 }
예제 #9
0
 protected override IModuleCatalog GetModuleCatalog()
 {
     return
         (ModuleCatalog.CreateFromXaml(
              new Uri("/RemoteModuleLoading;component/ModulesCatalog.xaml", UriKind.Relative)));
 }
예제 #10
0
        //protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        //{
        //    Type testType = typeof(TestModuleModule);
        //    moduleCatalog.AddModule(
        //        new ModuleInfo()
        //        {
        //            ModuleName = testType.Name,
        //            ModuleType = testType.AssemblyQualifiedName
        //        });
        //}

        protected override IModuleCatalog CreateModuleCatalog()
        {
            return(ModuleCatalog.CreateFromXaml(new Uri("pack://*****:*****@".\ModulesDirectory" };
        }