protected override IModuleCatalog CreateModuleCatalog() { using Stream xamlStream = File.OpenRead("Configuration/ModuleCatalog.xaml"); var moduleCatalog = ModuleCatalog.CreateFromXaml(xamlStream); return(moduleCatalog); }
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)); }
protected override IModuleCatalog CreateModuleCatalog() { // Конфигурация модуля описана в файле XamlCatalog.xaml. // На модуль reference не требуется. dll модуля кладется в нужную директорию. var uri = new Uri("/PrismDemo;component/XamlCatalog.xaml", UriKind.Relative); return(ModuleCatalog.CreateFromXaml(uri)); }
/// <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); }
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()); }
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)); }
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(); }
protected override IModuleCatalog GetModuleCatalog() { return(ModuleCatalog.CreateFromXaml( new Uri("/Prism.Shell;component/ModuleCatalog.xaml", UriKind.Relative))); }
protected override IModuleCatalog GetModuleCatalog() { return (ModuleCatalog.CreateFromXaml( new Uri("/RemoteModuleLoading;component/ModulesCatalog.xaml", UriKind.Relative))); }
//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" }; }