title: StackPanel in ScrollViewer WPF
body: <p>I've got a problem with extremly strange behaviour of ScrollViewer's ScrollBar.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;ScrollViewer CanContentScroll="True"&gt;
      &lt;StackPanel&gt;
          &lt;StackPanel&gt;
              &lt;Button Height="40"/&gt;
              &lt;Button Height="40"/&gt;
              &lt;Button Height="40"/&gt;
              &lt;Button Height="40"/&gt;
              &lt;Button Height="40"/&gt;
              &lt;Button Height="40"/&gt;
              &lt;Button Height="40"/&gt;
              &lt;Button Height="40" Background="Yellow"/&gt;
          &lt;/StackPanel&gt;
  
          &lt;StackPanel&gt;
              &lt;Button Height="40" Background="Red"/&gt;
              &lt;Button Height="40" Background="Red"/&gt;
              &lt;Button Height="40" Background="Red"/&gt;
              &lt;Button Height="40" Background="Red"/&gt;
              &lt;Button Height="40" Background="Red"/&gt;
              &lt;Button Height="40" Background="Red"/&gt;
              &lt;Button Height="40" Background="Red"/&gt;
              &lt;Button Height="40" Background="Red"/&gt;
              &lt;Button Height="40" Background="Red"/&gt;
              &lt;Button Height="40" Background="Red"/&gt;
              &lt;Button Height="40" Background="Green"/&gt;
          &lt;/StackPanel&gt;
      &lt;/StackPanel&gt;
  &lt;/ScrollViewer&gt;
  </code></pre>
  
  <p>The problem is in those StackPanels inside StackPanel. If there's only one main StackPanel without StackPanels inside it, it acts ok. </p>
  
  <p>I've tried using ScrollViewer inside main StackPanel for each of it's childrens. The other problem in that solution is that I don't want to have fixed height of StackPanels.</p>
  
  <p><strong>@EDIT:</strong>
  The problem is that ScrollBar doesn't shift smoothly and it prevents showing all the content. Sorry for lack of informations.</p>