title: User control inside ScrollViewer doesn't scroll in WPF
body: <p>I have the following code (abbreviated) in my main window:</p>
  
  <p>Although I set both scroll bar visibilities and <code>CanContentScroll</code> properties it doesn't scroll. I assume it has to do with my user control. </p>
  
  <pre><code>&lt;Window&gt;
     &lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="Auto" /&gt;
          &lt;RowDefinition Height="*" /&gt;
          &lt;RowDefinition Height="Auto" /&gt;
          &lt;RowDefinition Height="Auto" /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition/&gt;
      &lt;/Grid.ColumnDefinitions&gt;
         &lt;TabControl  Grid.Column="0" Grid.Row="0"  HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Stretch" Height="Auto" Width="Auto"&gt;
            &lt;TabItem Header="TEST"&gt;
              &lt;ScrollViewer HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"&gt;
              &lt;my:MY_USER_CONTROL  x:Name="myUserControl"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  ScrollViewer.CanContentScroll="True" /&gt;
              &lt;/ScrollViewer&gt;
          &lt;/TabItem&gt;
        &lt;/TabControl&gt;
        &lt;Button Grid.Column="0"  Grid.Row="2" &gt;a button&lt;/Button&gt;
        &lt;WrapPanel Grid.Column="0" Grid.Row="3" &gt;
        &lt;/WrapPanel&gt;
      &lt;/Grid&gt;
    &lt;/Window&gt;
  </code></pre>
  
  <p>Abbreviated structure of my user control:</p>
  
  <pre><code>&lt;UserControl&gt;
      &lt;Grid&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="183*" /&gt;
              &lt;ColumnDefinition Width="117*" /&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;TreeView ItemsSource="{Binding Children}" Grid.ColumnSpan="2"&gt;
              &lt;TreeView.ItemContainerStyle&gt;
                  &lt;Style TargetType="{x:Type TreeViewItem}"&gt;
  
                      &lt;Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /&gt;
                      &lt;Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /&gt;
  
                      &lt;Setter Property="FontWeight" Value="Normal" /&gt;
                      &lt;Style.Triggers&gt;
                          &lt;Trigger Property="IsSelected" Value="True"&gt;
                              &lt;Setter Property="FontWeight" Value="Bold" /&gt;
                          &lt;/Trigger&gt;
                      &lt;/Style.Triggers&gt;
                  &lt;/Style&gt;
              &lt;/TreeView.ItemContainerStyle&gt;
  
              &lt;TreeView.ItemTemplate&gt;
                  &lt;HierarchicalDataTemplate ItemsSource="{Binding Children}" &gt;
                      &lt;Grid&gt;
                          &lt;Grid.ColumnDefinitions&gt;
                              &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
                              &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
                          &lt;/Grid.ColumnDefinitions&gt;
                          &lt;Grid.RowDefinitions&gt;
                              &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
                          &lt;/Grid.RowDefinitions&gt;
                          &lt;Grid.Children&gt;
                              &lt;TextBlock Background="LightGray"  Padding="2" Margin="2" Grid.Row="0" Grid.Column="0" Text="{Binding Name}" /&gt;
                              &lt;TextBlock Padding="2" Margin="2" Grid.Row="0" Grid.Column="1" Text="{Binding Content}" /&gt;
                          &lt;/Grid.Children&gt;
                      &lt;/Grid&gt;
                  &lt;/HierarchicalDataTemplate&gt;
              &lt;/TreeView.ItemTemplate&gt;
          &lt;/TreeView&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>