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

http://stackoverflow.com/questions/9342294/simpleioc-can-it-provide-new-instance-each-time-required/9350917#9350917

最新文章

  1. ASP.NET Aries 入门开发教程4:查询区的下拉配置
  2. 浅谈Java中的equals和==(转)
  3. Python for Infomatics 第13章 网页服务三(译)
  4. HBASE列族不能太多的真相 (一个table有几个列族就有几个 Store)
  5. Shell 编程基础之 Select 练习
  6. UBoot讲解和实践-------------讲解(二)
  7. Jquery中获取iframe的代码方法
  8. 《剑指Offer》面试题-从头到尾打印链表
  9. 区别jquery对象和dom对象及转换方法
  10. 201521123070 《JAVA程序设计》第2周学习总结
  11. JavaScript定时器:setTimeout()和setInterval()
  12. Spring源码情操陶冶-任务定时器ConcurrentTaskScheduler
  13. aliyun install Discourse log
  14. java项目测试或者不使用request,如何获取webroot路径
  15. KVM -> 虚拟化简介&虚拟机安装_01
  16. Android 之 获取地理位置及监听
  17. PHP静态化(非伪静态化)
  18. Android中可以做的两件坏事——破解锁屏密码和获取Wifi密码
  19. 使用c++实现一个FTP客户端(一)
  20. 特征点检测学习_2(surf算法)

热门文章

  1. 动软MySQL存储过程模板
  2. Bag-of-words模型
  3. windows内核需要注意的
  4. 如何离线下载Chrome的安装包
  5. 权限管理AppOpsManager
  6. java测试时常见的一些错误
  7. unicode-range 字体混搭(转)
  8. poj1611 并查集 (路径不压缩)
  9. nefu1118 最长上升子序列(LIS)
  10. ASP.NET MVC3 中整合 NHibernate3.3、Spring.NET2.0 使用AOP执行事务处理