【发布时间】:2011-10-24 08:18:52
【问题描述】:
在 Caliburn.Micro 文档中,作者提到了这种可能性:
文档链接
IHandle inherits from a marker interface IHandle. This allows the use of casting to determine if an object instance subscribes to any events. This enables simple auto-subscribing if you integrate with an IoC container. Most IoC containers (including the SimpleContainer) provide a hook for being called when a new instance is created. Simply wire for your container’s callback, inspect the instance being created to see if it implement IHandle, and if it does, call Subscribe on the event aggregator.
如何使用 MEF 实现这一目标?
这个问题和Caliburn.Micro. Automatically call eventaggregator.Subscribe() for IHandle implementors with Autofac一样
那么与描述的 AutoSubscribeHandersModule 类似的功能如何在 MEF 中实现?
【问题讨论】:
标签: mef caliburn.micro