title: Re-implementing WindowManager using ModernUI + Caliburn.Micro combination
body: <p><a href="https://stackoverflow.com/questions/16421582/caliburn-micro-and-modernui-examples-tutorials/16439391#16439391">Here</a> Caliburn.Micro was successfully combined with ModernUI.
  But if we want to use multiple windows we also need to re-implement Caliburn's <code>WindowManager</code> to work properly with ModernUI. How can it be done?</p>
  
  <p><strong>UPDATE:</strong>
  (Additional question about IoC-Container/Dependency Injection)</p>
  
  <p>Ok, as I get it: I used a Constructor Injection here:</p>
  
  <pre><code>public class BuildingsViewModel : Conductor&lt;IScreen&gt;
  
  {
      public BuildingsViewModel(IWindowManager _windowManager)
      {
          windowManager = _windowManager;
      }
  }
  </code></pre>
  
  <p>As far as <code>BuildingsViewModel</code> resolved from IoC container,
  container itself injected <code>ModernWindowManager</code> implementation of <code>IWindowManager</code> interface because of this line in <code>Bootstrapper</code>'s <code>Configure()</code> method:</p>
  
  <pre><code>container.Singleton&lt;IWindowManager, ModernWindowManager&gt;();
  </code></pre>
  
  <p>If I resolving an object instance from container, it injects all needed dependencies. Like a tree.</p>
  
  <p>1) So now I wonder how can I replace this line using an injection(with interface)?
   <code>_windowManager.ShowWindow(new PopupViewModel());</code></p>
  
  <p>2) If I want my whole project match DI pattern, all objects instances must be injected into <code>ModernWindowViewModel</code>, that resolves from container first?</p>
  
  <p>3) Is it okay to use Caliburn's <code>SimpleContainer</code> for whole project, or better use mature framework like Castle Windsor? Should I avoid mixing?</p>
  
  <p><strong>UPDATE2:</strong></p>
  
  <p>4) Integrating an IoC container into an existing application requires creating this container first(in <code>Main()</code> method of console app for example), and then all object instanses must grow from it with injected dependencies?</p>