title: Scrolling for WPF TabItems (not entire TabControl)
body: <p>I have the following xaml: </p>
  
  <pre><code>&lt;UserControl x:Class="MyProject.Word.Addin.Presentation.MainTaskPane" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
           xmlns:local="clr-namespace:MyProject.Word.Addin.Presentation" 
           mc:Ignorable="d"&gt;
  &lt;d:UserControl.DataContext&gt;
      &lt;local:MyProjectPaneViewModelHandler /&gt;
  &lt;/d:UserControl.DataContext&gt;
  &lt;!--&lt;Grid&gt;--&gt;
  
      &lt;DockPanel Name="MainDockPanel" Background="red"&gt;
          &lt;local:ExToolBar DockPanel.Dock="Top" /&gt;
          &lt;Button DockPanel.Dock="Top" Click="ButtonGetHeightDimensions" Content="Show Dimensions" Height="40"&gt;&lt;/Button&gt;
          &lt;TabControl DockPanel.Dock="Top" x:Name="TabControl1" Background="LightSkyBlue"&gt;
              &lt;TabItem x:Name="Tab1" Background="LightGreen"&gt; 
                  &lt;TabItem.Header&gt;
                      &lt;StackPanel Orientation="Horizontal"&gt;
                          &lt;Ellipse Width="10" Height="10" Fill="DarkGray"/&gt;
                          &lt;TextBlock&gt;Filters&lt;/TextBlock&gt;
                      &lt;/StackPanel&gt;
                  &lt;/TabItem.Header&gt;
                  &lt;ScrollViewer Name="ScrollViewer1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"&gt;
                  &lt;StackPanel Name="Tab1StackPanel" Orientation="Vertical" MaxHeight="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type TabControl}}, Path=ActualHeight}" &gt;
                          &lt;TextBlock FontSize="24" FontWeight="Bold" Foreground="DarkSlateGray" FontStyle="Normal"&gt;
                          Filters
                      &lt;/TextBlock&gt;
                      &lt;Button x:Name="ClearFiltersButton" Click="ClearFilters_OnClick" Background="DarkRed" Foreground="White"
                              FontSize="20" FontWeight="Bold" MaxWidth="124" HorizontalAlignment="Left"&gt;
                          Clear Filters
                      &lt;/Button&gt;
                      &lt;StackPanel Orientation="Horizontal"&gt;
                          &lt;TextBlock&gt;
                              &lt;Run&gt;Total Paragraphs &lt;/Run&gt;&lt;Run Text="{Binding ResearchLanguageViewModel.TotalCount}"&gt;&lt;/Run&gt;
                          &lt;/TextBlock&gt;
                      &lt;/StackPanel&gt;
                      &lt;ItemsControl ItemsSource="{Binding ResearchLanguageViewModel.Filters, Mode=OneWay}"&gt;
                          &lt;ItemsControl.ItemTemplate&gt;
                              &lt;DataTemplate&gt;
  
                                  &lt;StackPanel&gt;
                                      &lt;TextBlock Text="{Binding Path=Type}"&gt;&lt;/TextBlock&gt;
                                      &lt;TextBox Text="Search...."&gt;&lt;/TextBox&gt;
                                      &lt;ItemsControl ItemsSource="{Binding Path=Values, Mode=OneWay}"&gt;
                                          &lt;ItemsControl.ItemTemplate&gt;
                                              &lt;DataTemplate&gt;
                                                  &lt;CheckBox Content="{Binding Mode=OneWay}"&gt;&lt;/CheckBox&gt;
                                              &lt;/DataTemplate&gt;
                                          &lt;/ItemsControl.ItemTemplate&gt;
                                      &lt;/ItemsControl&gt;
                                  &lt;/StackPanel&gt;
                              &lt;/DataTemplate&gt;
                          &lt;/ItemsControl.ItemTemplate&gt;
                      &lt;/ItemsControl&gt;
                  &lt;/StackPanel&gt;
                      &lt;/ScrollViewer&gt;
              &lt;/TabItem&gt;
              &lt;TabItem x:Name="Tab2"&gt;
                  &lt;TabItem.Header&gt;
                          &lt;TextBlock&gt;A 2nd Tab&lt;/TextBlock&gt;
                  &lt;/TabItem.Header&gt;
                  &lt;StackPanel Orientation="Horizontal"&gt;
                          &lt;TextBlock&gt;
                              &lt;Run&gt;Mama always said lifes like a box of chocolates...&lt;/Run&gt;
                          &lt;/TextBlock&gt;
                  &lt;/StackPanel&gt;
              &lt;/TabItem&gt;
          &lt;/TabControl&gt;
      &lt;/DockPanel&gt;
  &lt;!--&lt;/Grid&gt;--&gt;
  </code></pre>
  
  <p></p>
  
  <p>And the following objects....</p>
  
  <pre><code>public class FilterViewModel
  {
      public string Type { get; set; }
      public ObservableCollection&lt;string&gt; Values { get; set; }
  }
  
  public class ResearchLanguageViewModel
  {
      public int FirmCount { get; set; }
      public ObservableCollection&lt;FilterViewModel&gt; Filters { get; set; } 
  }
  </code></pre>
  
  <p>I have binding setup using the INotifyPropertyChanged, etc... and all is working.  The final issue I have is with the Scrolling of the TabItem content in my first tab. The requirements call for only the tabs with overflowing content to scroll and not the entire tab control. I.e. - the tab headers should still be viewable including controls above the tab control itself and the scroll bars should appear <em>inside</em> of Tab1's TabItem area.  I've played with this for hours to no avail.  I'm obviously doing something wrong here and could use some assistance. </p>
  
  <p>A bit more detail:  The binding on the CheckBox(es) / ItemControls on the Values collection can have upward of 200 - 500 controls and thus causes everything to get knocked out of wack. </p>