Prism 6 与旧版本的兼容性 [英] Prism 6 compatibility with older versions

查看:85
本文介绍了Prism 6 与旧版本的兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 Prism 5 (WPF) 的主项目的解决方案.此解决方案还包含更多属于 Prism 模块的项目.

I have a solution with a main project that uses Prism 5 (WPF). This solution also contains many more projects that are Prism modules.

现在要新建一个模块,不知道能不能只在那个模块中使用Prism 6,会兼容Prism 5主项目,还是需要在所有模块中继续使用Prism 5(或者将整个解决方案升级到 Prism 6,这是一项非常大的工作).

Now I have to create a new module, and I wonder if I can use Prism 6 only in that module, and it will be compatible with Prism 5 main project, or if I need to continue with Prism 5 in all the modules (or upgrade the entire solution to Prism 6, what is a really big work).

谢谢

推荐答案

您必须坚持使用 Prism 5 或将所有内容升级到 Prism 6.这些版本之间有一些重大变化:

You'll have to stick with Prism 5 or upgrade everything to Prism 6. There are some breaking changes between these versions:

  • 删除了所有在 Prism 5 中标记为过时"的类型
  • 移除了 IView 接口
  • 更改命名空间以移除 Microsoft 命名空间
  • 移动了许多类型以更好地组织并将尽可能多的内容放入单个可移植类库中
  • ViewModelLocator 命名约定更改:[Name]View 现在需要 [Name]ViewModel.不再是 [Name]ViewViewModel

来源:https://github.com/PrismLibrary/Prism/blob/master/README.md

仅更改命名空间就足以破坏"您的应用程序.您现在将拥有 2 个不同的实例,例如EventAggregator(因为它们位于不同的命名空间中).

The namespace change alone is already enough to 'break' your application. You'll now have 2 different instances of e.g. EventAggregator (as they live in a different namespace).

这篇关于Prism 6 与旧版本的兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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