title: How can I have Prism/Unity automatically resolve a View (UserControl)?
body: <p>In a Composite Application (Prism), <strong>when my module loads</strong>, I get this error:</p>
  
  <blockquote>
    <p>{"The current build operation (build
    key Build
    Key[CustomersModul.ViewModels.CustomerAllViewModel,
    null]) failed: The parameter view
    could not be resolved when attempting
    to call constructor
    CustomersModul.ViewModels.CustomerAllViewModel(CustomersModul.Views.CustomerAllView
    view). (Strategy type
    Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy,
    index 2)"}</p>
  </blockquote>
  
  <p>I am <strong>resolving</strong> this class:</p>
  
  <pre><code>CustomerAllViewModel layoutManager = this.container.Resolve&lt;CustomerAllViewModel&gt;();
  </code></pre>
  
  <p>And that class looks like <strong>this</strong>:</p>
  
  <pre><code>public class CustomerAllViewModel : ViewModelBase
  {
      public CustomerAllView View { get; set; }
      public ICommand TextChangeCommand { get; set; }
      private Customer customer;
  
  public CustomerAllViewModel(CustomerAllView view)
  {
      View = view;
      view.DataContext = this;
      ...
  </code></pre>
  
  <p>Normally I resolve <strong>Presenters</strong> which have no constructor parameters and instantiate their views internally. This is the first time I am using a <strong>ViewModel</strong> which accepts a View as parameter. </p>
  
  <p>Interestingly, when I go to the view with <strong>Resharper</strong>, it asks me if I want to go to the XAML or code behind, so perhaps Prism is getting confused which one to instantiate?</p>
  
  <p><strong>How can I get Prism to automatically instantiate this view (UserControl with XAML and code-behind) in the parameter?</strong></p>