MVVM deep dive
You can get a different instance each time by passing a different key to the GetInstance method. However the instances will be cached, so if you do not want to keep them in the cache, you will need to call Unregister with the corresponding key.
I was creating the VM upfront because the MainVM was sending messages to the SecondaryVM. Since the registration to the Messenger is done in the SecondaryVm's constructor, it needs to be created before it can start receiving messages. The Messenger is great because it is very decoupled, but it is one of these cases where you need to do extra work to compensate the decoupling: The SecondaryVM is the target of messages even though the MainVM does not get any reference to it.
Ref:
http://channel9.msdn.com/Events/MIX/MIX11/OPN03
最新文章
- ASP.NET Aries 入门开发教程4:查询区的下拉配置
- 浅谈Java中的equals和==(转)
- Python for Infomatics 第13章 网页服务三(译)
- HBASE列族不能太多的真相 (一个table有几个列族就有几个 Store)
- Shell 编程基础之 Select 练习
- UBoot讲解和实践-------------讲解(二)
- Jquery中获取iframe的代码方法
- 《剑指Offer》面试题-从头到尾打印链表
- 区别jquery对象和dom对象及转换方法
- 201521123070 《JAVA程序设计》第2周学习总结
- JavaScript定时器:setTimeout()和setInterval()
- Spring源码情操陶冶-任务定时器ConcurrentTaskScheduler
- aliyun install Discourse log
- java项目测试或者不使用request,如何获取webroot路径
- KVM ->; 虚拟化简介&;虚拟机安装_01
- Android 之 获取地理位置及监听
- PHP静态化(非伪静态化)
- Android中可以做的两件坏事——破解锁屏密码和获取Wifi密码
- 使用c++实现一个FTP客户端(一)
- 特征点检测学习_2(surf算法)