title: ScrollViewer thumb is not moving
body: <p>I have a <code>TreeView</code> control, and its template is set like this:</p>
  
  <pre><code>&lt;TreeView.Template&gt;
      &lt;ControlTemplate&gt;
          &lt;Border BorderBrush="DeepSkyBlue" BorderThickness="1"&gt;
              &lt;ScrollViewer CanContentScroll="False" 
                            Height="{Binding RelativeSource={RelativeSource AncestorType=TreeView}, Path=ActualHeight}"&gt;
                  &lt;ItemsPresenter /&gt;
              &lt;/ScrollViewer&gt;
          &lt;/Border&gt;
      &lt;/ControlTemplate&gt;
  &lt;/TreeView.Template&gt;
  </code></pre>
  
  <p>The <code>TreeView</code> is filled dynamically:</p>
  
  <p><img src="https://i.stack.imgur.com/4ckKI.gif" alt="TreeView filling (gif)"></p>
  
  <p>There are two levels of the <code>TreeViewItem</code> nodes:</p>
  
  <p><img src="https://i.stack.imgur.com/9TKWz.gif" alt="TreeViewItem nodes (gif)"></p>
  
  <p>And the thumb is moving while in sub items are present only items below:</p>
  
  <p><img src="https://i.stack.imgur.com/4hVx0.png" alt="Sub items"></p>
  
  <p>The Thumb moving: </p>
  
  <p><img src="https://i.stack.imgur.com/MBTXo.gif" alt="thumb is moving (gif)"></p>
  
  <p>But when I'm trying to add these items below:</p>
  
  <p><img src="https://i.stack.imgur.com/madjJ.png" alt="Sub items"></p>
  
  <p>...the thumb is not scrolling, but the <code>ScrollBar</code> area is active:</p>
  
  <p><img src="https://i.stack.imgur.com/OFb6A.gif" alt="thumb is not moving"></p>
  
  <p>The template of elements is completely the same, but they differ only in the textblock and the image.</p>
  
  <p>I'm stuck on this and can't understand what's wrong. </p>
  
  <p>Which property of the <code>ScrollViewer</code> may be changing, which leads to this behavior. Here is the link to the full definition of the <code>TreeView</code>: <a href="https://github.com/celephais19/shaft-component-generator/blob/master/src/InventorShaftGenerator/InventorShaftGenerator/Views/MainWindow.xaml#L1780" rel="nofollow noreferrer">the treeview definition on github</a>.</p>