title: Dynamically Add Tabs to DevExpress DXTabControl WPF, MVVM
body: <p>I am having few menu items and on click of each menu item, I need to load up corresponding ViewModel as a new tab. To achieve this I have taken below approach:</p>
  
  <pre><code> &lt;dx:DXTabControl OverridesDefaultStyle="True" Margin="2" BorderThickness="0" Padding="0" dxlc:DockLayoutControl.Dock="Client"
                               Grid.Row="1" ItemsSource="{Binding Workspaces}"&gt;
                  &lt;dx:DXTabControl.View&gt;                        
                      &lt;dx:TabControlScrollView ShowHeaderMenu="True" ShowHiddenTabItemsInHeaderMenu="False" HeaderLocation="Top" HeaderOrientation="Horizontal" AllowAnimation="True" AllowHideTabItems="True" AutoHideScrollButtons="True" 
                                               ScrollViewer.PanningMode="HorizontalOnly" ScrollButtonsShowMode="WhenNeeded"/&gt;
                  &lt;/dx:DXTabControl.View&gt;
                  &lt;dx:DXTabControl.ItemTemplate&gt;
                      &lt;DataTemplate&gt;
                          &lt;ContentControl Content="{Binding Content}"/&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/dx:DXTabControl.ItemTemplate&gt;
              &lt;/dx:DXTabControl&gt;
  </code></pre>
  
  <p>and in ViewModel (C#):</p>
  
  <pre><code> public ObservableCollection&lt;DXTabItem&gt; Workspaces
      {
          get { return workspaces; }
          set { this.Set&lt;ObservableCollection&lt;DXTabItem&gt;&gt;("Workspaces", ref this.workspaces, value); }
      }
  </code></pre>
  
  <p>and to load the ViewModel:</p>
  
  <pre><code>Workspaces = new ObservableCollection&lt;DXTabItem&gt;() { new DXTabItem() { Header = header,
              Content = contentDetails, IsSelected= true, AllowHide = (((WorkspaceViewModel)contentDetails).AllowTabHiding) ? DefaultBoolean.True: DefaultBoolean.False } };
  </code></pre>
  
  <p>This approach works well, and gives me the desired behavior. But I do like to get rid off DXTabItem from my ViewModel, as this makes the ViewModel aware of the View. Please let me know the best way to tackle this.</p>
  
  <p>Thanks!
  Sid</p>