Prism 6-将ConfigurationModuleCatalog与DirectoryModuleCatalog合并 [英] Prism 6 - Merge ConfigurationModuleCatalog with DirectoryModuleCatalog

查看:55
本文介绍了Prism 6-将ConfigurationModuleCatalog与DirectoryModuleCatalog合并的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近与Prism 6一起工作,并且想从app.config中引用核心模块(这样将来就可以替换掉它们,而无需重新编译.整个棱镜!).但是,我想将该功能添加到插件体系结构的扩展模块中,因此希望将ConfigurationModuleCatalog与DirectoryModuleCatalog对象合并以简化插件"目录.我的问题:有正式"的方式可以做到吗?我一直找不到方法,但是我的Google搜索字词可能不正确!还是我必须通过在初始化时手动合并目录来将其合并在一起?

I have recently working with Prism 6, and would like to reference core modules from an app.config (so they can be swapped out in future without recompile..the whole point of prism!). However, I would like to then add that functionality to extension modules for a plugin architecture, so would therefore like to merge the ConfigurationModuleCatalog with a DirectoryModuleCatalog object to facilitate a "plugins" directory. My question: Is there an "official" way to do it? I haven't been able to find a way, but my Google search terms were perhaps incorrect! Or do I have to hack it together by manually merging the catalogs on initialisation?

推荐答案

这很容易做到.此示例向您展示如何使用AggregateCatalog

This is very easy to do. This sample shows you how to use an AggregateCatalog

https://github.com/PrismLibrary/Prism-Samples-Wpf/tree/master/Modularity/ModularityWithUnity

这篇关于Prism 6-将ConfigurationModuleCatalog与DirectoryModuleCatalog合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆