WPF(3)概述Prism框架2
序言
Prism知识章节
1.Region(区域管理)
2.Module(模块)
3.View Injection(视图注入)
4.ViewModelLocationProvider(视图模型定位)
5.Command(绑定相关)
6.Event Aggregator (事件聚合器)
7.Navigation(导航)
8.Dialog(对话框)
其他
DataContext
DataContext连接View与ViewModel挂钩
构造函数注入(Constructor Injection)
注入是将依赖注入对象的过程。 构造函数注入很常见。 在此过程中,依赖项作为参数注入构造函数。 请参阅下面的示例。
@Inject public TextEditor(SpellChecker spellChecker) { this.spellChecker = spellChecker; }
set注入的缺点是无法清晰表达哪些属性是必须的,哪些是可选的,构造注入的优势是通过构造强制依赖关系,不可能实例化不完全的或无法使用的bean。
资料
https://github.com/PrismLibrary
https://www.bilibili.com/video/BV1it4y1G7q7?p=18&vd_source=a56db24cb8cab4dd8153f9a519787c89
http://t.zoukankan.com/fishpond816-p-15216765.html