title: WPF Item Templates - TabControl
body: <p>I am writing an application in which I utilize a tab control which will start with one tab open but allows the user to open multiple other tabs.</p>
  
  <p>Each tab that is openned should have a treeview inside which I fill using databinding when the user loads a file.</p>
  
  <p>I am new to WPF but I feel as if there is a way in which I can create a template containing each of the elements the TabItems should contain. How can I do this using templates? Right now my WPF for the tab items is the following</p>
  
  <pre><code>&lt;TabItem Header="Survey 1"&gt;
          &lt;TreeView Height="461" Name="treeView1" VerticalAlignment="Top" 
                    Width="625" Margin="0,0,6,0" ItemTemplateSelector="{StaticResource TreeviewDataSelector}" /&gt;
   &lt;/TabItem&gt;
  </code></pre>