title: Intercept Ninject instance activation?
body: <p>I'm trying to put an example together of using Caliburn Micro on WP7 with Ninject.  Everything was pretty straight forward.  However, I'm stuck on how to go about firing an event once an instance is Activated by Ninject.</p>
  
  <p>Here is the ActivateInstance method in Caliburn Micro's SimpleContainer, the IoC container that comes with CM for the phone.</p>
  
  <pre><code> protected virtual object ActivateInstance(Type type, object[] args) {
              var instance = args.Length &gt; 0 ? Activator.CreateInstance(type, args) : Activator.CreateInstance(type);
              Activated(instance);
              return instance;
          }
  </code></pre>
  
  <p>I register my types in Ninject and when they're activated I need to fire the Activated event.  I looked at interception which might be the route to go but I don't think dynamic proxy and Linfu is going to work on the phone.</p>
  
  <p>To clarify more, I'm not using the SimpleContainer, the above is to show what SimpleContainer does when an instance is activated.  I have a NinjectBootstrapper and a NinjectContainer that implements IPhoneContainer.  I can't figure out how to implement <code>event Action&lt;object&gt; Activated;</code> with Ninject.</p>
  
  <p><strong>update:</strong> <code>.OnActivation()</code> looks like the ticket.</p>
  
  <pre><code>Kernel.Bind&lt;IMyService&gt;().To&lt;MyService&gt;().InSingletonScope().OnActivation();
  </code></pre>