title: Why won't my ScrollViewer Scrollbars appear on the screen?
body: <p>I have an issue with a WPF C# project, where I have a StackPanel on my Form, within that I have a DockPanel which has items added to it programmatically, the problem is that the items are going out of the form's bounds and I would like to scroll through these, I already have a method for "Scrollifying" the items, but for the life of me I can't see why the scrollbars aren't appearing on the screen, am I missing something?</p>
  
  <p>Code is below, any suggestions are more than welcome.</p>
  
  <pre><code> private void ScrollifyStackpanel(StackPanel Panel)
          {
              ScrollViewer SV = new ScrollViewer();
              SV.Height = Panel.ActualHeight;
              SV.Width = Panel.ActualWidth;
  
  
              SV.CanContentScroll = true;
              SV.Content = Panel;
  
          }
  </code></pre>
  
  <p>Xaml</p>
  
  <p>this is the stackpanel containing the (should be) scrollable content</p>
  
  <pre><code>&lt;StackPanel Name="divParentPanel" VerticalAlignment="Top"  DockPanel.Dock="Left" Margin="10" Width="Auto" HorizontalAlignment="Stretch" CanVerticallyScroll="True"&gt;
  </code></pre>
  
  <p></p>