title: DevExpress - MVVM - Generate TabItems with different ViewModels
body: <p>i have a DXTabControl. The DXTabItems are generated via my ViewModel.</p>
  
  <p><strong>//MainViewModel</strong></p>
  
  <pre><code>public MainViewModel()
  {
      var items = new ObservableCollection&lt;DXTabItem&gt;();
      items.Add(
          new DXTabItem()
          {
              Header = "Test1",
              Content = new WebViewModel()
          });
  
      items.Add(
          new DXTabItem()
          {
              Header = "Test2",
              Content = new CMSViewModel()
          });
  
      TabItems = items;
  }
  
  private ObservableCollection&lt;DXTabItem&gt; _tabItems;
  public ObservableCollection&lt;DXTabItem&gt; TabItems
  {
      get { return _tabItems; }
      set { SetProperty(ref _tabItems, value, () =&gt; TabItems); }
  }
  </code></pre>
  
  <p>I am working with a DataTemplate and my TabItem is still not showing any UserControl.</p>
  
  <p><strong>//MainView.xaml</strong></p>
  
  <pre><code>&lt;DataTemplate x:Key="WebTemplate" DataType="{x:Type viewmodel:WebViewModel}"&gt;
      &lt;view:WebView/&gt;
  &lt;/DataTemplate&gt;
  
  &lt;DataTemplate x:Key="CMSTemplate" DataType="{x:Type viewmodel:CMSViewModel}"&gt;
      &lt;view:CMSView/&gt;
  &lt;/DataTemplate&gt;
  
  &lt;datatemplate:TemplateSelector x:Key="DataTemplateSelector" 
                          WebTemplate="{StaticResource WebTemplate}"
                          CMSTemplate="{StaticResource CMSTemplate}" /&gt;
  
  &lt;dx:DXTabControl ItemsSource="{Binding TabItems}" ItemTemplateSelector="{StaticResource DataTemplateSelector}" /&gt;
  </code></pre>
  
  <p><strong>//DataTemplateSelector</strong></p>
  
  <pre><code>public class TemplateSelector : DataTemplateSelector
  {
      public DataTemplate WebTemplate { get; set; }
      public DataTemplate CMSTemplate { get; set; }
  
      public override DataTemplate SelectTemplate(Object item,
          DependencyObject container)
      {
  
          if (item == null) return base.SelectTemplate(item, container);
  
          if (item.GetType() == typeof(WebViewModel))
          {
              return WebTemplate;
          }
  
          else if (item.GetType() == typeof(CMSViewModel))
          {
              return CMSTemplate;
          }
  
          else return base.SelectTemplate(item, container);
  
      }
  }
  </code></pre>
  
  <p>Everything is working, except showing the content i need. No view is been shown. Any idea? Did i miss something?</p>