title: How can Windsor create one component for each resolve invocation?
body: <p>Consider the following classes:</p>
  
  <pre><code>public interface IView
  {
      /// &lt;summary&gt;
      /// Ignore this (its only for the assertion)
      /// &lt;/summary&gt;
      ITask Task { get; }
  }
  
  public class ViewA : IView
  {
      private readonly ITask _task;
  
      public ViewA(ITask task)
      {
          _task = task;
      }
  
      public ITask Task
      {
          get { return _task; }
      }
  }
  public class ViewB : IView
  {
      private readonly ITask _task;
  
      public ViewB(ITask task)
      {
          _task = task;
      }
  
      public ITask Task
      {
          get { return _task; }
      }
  }
  
  public class ViewManager
  {
      private readonly List&lt;IView&gt; _views;
  
      public ViewManager(IView[] views)
      {
          _views = new List&lt;IView&gt;(views);
      }
  
      public ReadOnlyCollection&lt;IView&gt; Views
      {
          get { return new ReadOnlyCollection&lt;IView&gt;(_views); }
      }
  }
  </code></pre>
  
  <p>And finally what I am trying to accomplish:</p>
  
  <pre><code>    [Fact]
      public void Configure_TwoServicesWithDependencyToTransientComponent_BothShareComponent()
      {
          // arrange
          var windsorContainer = new WindsorContainer();
  
          windsorContainer.Kernel.Resolver.AddSubResolver(new ArrayResolver(windsorContainer.Kernel));
  
          windsorContainer.Register(Component.For&lt;ITask&gt;()
              .ImplementedBy&lt;TaskWithNoDependencies&gt;()
              .Named("task")
              .LifeStyle.Transient);
  
          windsorContainer.Register(Component.For&lt;IView&gt;().ImplementedBy&lt;ViewA&gt;().LifeStyle.Transient);
          windsorContainer.Register(Component.For&lt;IView&gt;().ImplementedBy&lt;ViewB&gt;().LifeStyle.Transient);
  
          windsorContainer.Register(Component.For&lt;ViewManager&gt;()
              .LifeStyle.Transient);
  
          // act
          ViewManager service = windsorContainer.Resolve&lt;ViewManager&gt;();
  
          // assert
          Assert.Same(service.Views[0].Task, service.Views[1].Task);
      }
  </code></pre>
  
  <p>How can I make Windsor create an instance of ITask so thats its shared by ViewA and ViewB when resolving ViewManager? I tried the following but it did not work:</p>
  
  <pre><code>        windsorContainer.Register(Component.For&lt;ViewManager&gt;()
              .DynamicParameters((k, d) =&gt;
                                     {
                                         d["task"] = k.Resolve&lt;ITask&gt;();
  
                                     })
              .LifeStyle.Transient);
  </code></pre>