title: How to add controls inside WPF TabControl via XAML
body: <p>I have the following <code>XAML</code>, a <code>TabControl</code> which binds to an <code>ObservableCollection</code> and creates my tabs just fine.</p>
  
  <pre><code>&lt;Window x:Class="BA_Auditing.AuditWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="BizeAsset - Audit Results" Height="700" Width="1120" WindowStartupLocation="CenterScreen" WindowState="Maximized"&gt;
      &lt;Grid&gt;
          &lt;TabControl Name="ModuleTabControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5" ItemsSource="{Binding}" &gt;
              &lt;TabControl.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;TextBlock&gt;                            
                          &lt;TextBlock Text="{Binding DISPLAY_NAME}"/&gt;
                      &lt;/TextBlock&gt;
                  &lt;/DataTemplate&gt;
              &lt;/TabControl.ItemTemplate&gt;
  
              &lt;TabControl.ContentTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;Grid&gt;
                          &lt;Grid.RowDefinitions&gt;
                              &lt;RowDefinition /&gt;
                              &lt;RowDefinition Height="Auto" /&gt;
                              &lt;RowDefinition /&gt;
                          &lt;/Grid.RowDefinitions&gt;
                          &lt;Grid Grid.Row="0"&gt;
                              &lt;Grid.ColumnDefinitions&gt;
                                  &lt;ColumnDefinition /&gt;
                                  &lt;ColumnDefinition /&gt;
                              &lt;/Grid.ColumnDefinitions&gt;
                              &lt;TextBlock Grid.Column="0" Text="Search:" HorizontalAlignment="Right"/&gt;
                              &lt;TextBox x:Name="tbxSearch" Grid.Column="1"/&gt;
                          &lt;/Grid&gt;
                          &lt;TextBlock Grid.Row="2" Text="Items Selected: 0 of 908" /&gt;
                      &lt;/Grid&gt;
                  &lt;/DataTemplate&gt;
              &lt;/TabControl.ContentTemplate&gt;
          &lt;/TabControl&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>Next I'd like to populate each tab area with the next level of controls, which will include a <code>Label</code>, <code>TextBox</code> another <code>TabControl</code> and a <code>TextBlock</code>.</p>
  
  <p>I previously wrote this in <code>WinForms</code> and this is what it looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/tip1Q.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tip1Q.jpg" alt="enter image description here"></a></p>
  
  <p>What <code>XAML</code> do I need add to do this? <br/>
  That is because I am designing it dynamically via binding rather than literally adding a <code>TabItem</code></p>
  
  <p>[EDIT]<br/>
  I have tried to enter controls into the <code>TabControl.ContentTemplate</code> however nothing displays in the body of the TabItem.<br/>
  <a href="https://i.stack.imgur.com/zdUNp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zdUNp.jpg" alt="enter image description here"></a></p>