title: Binding collection of viewmodels to WPF MVVM TabControl
body: <p>I have a collection of ViewModels I want to bind to the <code>ItemsSource</code> property of a <code>TabControl</code> and be able to add/remove them dynamically, so have implemented as an <code>Observable&lt;TabViewModel&gt;</code>.</p>
  
  <p>However the <code>TabControl</code> seems to expect types which inherit from <code>TabItem</code>, which is a visual control object. I don't want my ViewModels to inherit from <code>TabItem</code> as that means they then need to be bound to a visual implementation and also all tests need to run as STA. </p>
  
  <p>How can I bind a collection of ViewModels to populate the headers and content of a tab control without depending on the <code>TabItem</code> object? Ie just using styles and templates I suppose based on the ViewModel type. Just like if you had a <code>ListBox</code> and wanted the items to render directly from viewmodel instances, with a specific template, that is easy to do by overriding the <code>ItemTemplate</code> property.</p>
  
  <p>How do I do this with a <code>TabControl</code> without using <code>TabItem</code>?</p>