title: How do I specify DataContext (ViewModel) type to get design-time binding checking in XAML editor without creating a ViewModel object?
body: <p>I can specify DataContext like this:</p>
  <pre><code>&lt;Window ... &gt;
      &lt;Window.DataContext&gt;
          &lt;MainViewModel /&gt;
      &lt;/Window.DataContext&gt;
      ...
  &lt;/Window&gt;
  </code></pre>
  <p>And in this case WPF will create an object of type MainViewModel and assign it to the window's DataContext property (this happens inside Window's <code>InitializeComponent()</code> method).</p>
  <p>But what if my <code>ViewModel</code> doesn't have a default constructor. Or what if I want to initialize ViewModel and assign it to DataContext after <code>Window.InitializeComponent()</code> is executed (inside Window's constructor or from the same code which instantiates the window) - in this case WPF creates a ViewModel (inside <code>InitializeComponent()</code>), assigns it to window's DataContext and then I overwrite it with another instance of ViewModel (I'm worried about unnecessary object instantiation here).</p>
  <p>I would like to be able to specify just a type of <code>ViewModel</code>, so I would get design-time warning if I misspell a property name inside {Binding} (or after renaming the property), or I could Go To Declaration by clicking (in XAML) on a property name inside <code>{Binding PropertyName}</code>.</p>