Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在构建一个有点复杂的棱镜应用程序。客户要求迫使我使用 ModuleB 中的 ModuleA 功能。
我的问题是,当我在 ModuleB 中引用 ModuleA 命名空间并导航到它的视图时,它是否打破了 prism 的解耦目的。如果是,那么我该如何解决这个问题?
该方法的两个 化身RequestNavigate(这是开始导航的推荐方式)有意将视图指定为 URI,以便不需要在模块代码中指定视图的实际类型。
RequestNavigate
从名称解析实际类型和从类型解析实例分别由区域管理器和容器完成,两者都是在应用程序的引导序列期间配置的,不属于任何特定模块。
您目前如何跨模块边界导航?
您需要通过它使用IEventAggregator和发布/订阅弱事件(CompositePresentationEvent<TPayload>)。
IEventAggregator
CompositePresentationEvent<TPayload>
这是一个示例。
这是相关的 msdn 链接。