title: Scrollviewer enabled if resolution too low on Windows display
body: <p>Been wrestling with this seemingly easy problem for a couple hours.</p>
  
  <p>I have a main window, and inside that window is a canvas that holds a tab control.  The tab control houses various user controls.  The user controls fit the window just fine when it is full size (and the window has to be fixed size).  However, one of the machines this runs on is lower resolution than the main window size.  So I put a maxheight in code behind the main window to only size to the max height/width of the display.</p>
  
  <pre><code> public MainWindow()
      {
          InitializeComponent();
  
          this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight - 20;
          this.MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;
  ...
  </code></pre>
  
  <p>So now the main window is only as big as the screen (minus the size of the taskbar).  Which is good.  I, however, can't seem to make any scrollbars appear at the right scope (which is over the whole window).  So, when the resolution is too small I want a window no bigger than the screen and which has scrollbars to scroll through the entirety of its content.  </p>
  
  <p>I've tried placing a Scrollviewer at multiple levels, but even though I can show the scrollbars, I can never get them to enable.  I figure this is because none of the content of the main window is ever too big for it, I just can't see it cause the window size is smaller (as each content item fits exactly inside it's parent).</p>
  
  <p>So, how do I make the window scroll all of it's content?  I've tried enabling Horizontal &amp; Vertical scrolling in the window xaml and enclosing the canvas, also.  I've also tried wrapping the window around a scrollviewer (which doesn't work). </p>
  
  <p>What am I missing, in either xaml or codebehind.</p>
  
  <p>P.S. - I've taken out all the scrollViewer references I've been messing with in case my fumblings confuse someone.</p>
  
  <pre><code>&lt;Window x:Class="myWin.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:usercontrols="myControls"
      Title="PCU ATS" Height="985" Width="1280" Left="0" Top="0" Background="#FFAE4949" ResizeMode="NoResize"&gt;
  
  &lt;i:Interaction.Triggers&gt;
      &lt;i:EventTrigger EventName="Closing"&gt;
          &lt;i:InvokeCommandAction Command="{Binding CloseCmd}" /&gt;
      &lt;/i:EventTrigger&gt;
  &lt;/i:Interaction.Triggers&gt;
  
  &lt;Canvas Background="CadetBlue"&gt;
      &lt;TextBlock x:Name ="debugBlock" Canvas.Left="1030" TextWrapping="Wrap" Text="" Canvas.Top="4" Width="91"/&gt;
      &lt;Button x:Name= "btnLogIn" Content="Access Debug" Command="{Binding LoginCmd}" VerticalAlignment="Top" Height="23" Background="Maroon" Foreground="White" BorderBrush="#FF060303" Canvas.Left="1126" Width="79" /&gt;
  
          &lt;TabControl Canvas.Left="0" Canvas.Top="0" Height="946" Name="mainTabControl" Width="1264" Padding="0" ScrollViewer.CanContentScroll="True" &gt;
          &lt;TabItem Header="Test Description" Name="testTab" FontWeight="Bold"&gt;
              &lt;Grid Background="LightSteelBlue"&gt;
                      &lt;usercontrols:testDescEntry x:Name="userControl1" Loaded="testUserControl_Loaded" ScrollViewer.CanContentScroll="True" Margin="0,0,0.5,0" /&gt;
              &lt;/Grid&gt;
          &lt;/TabItem&gt;
  
          &lt;TabItem Header="Start Test" Name="sTab" FontWeight="Bold" ScrollViewer.CanContentScroll="True"&gt;
              &lt;Grid Background="LightSteelBlue" ScrollViewer.CanContentScroll="True"&gt;
                  &lt;usercontrols:StartCon x:Name="userControl2" ScrollViewer.CanContentScroll="True"/&gt;
              &lt;/Grid&gt;
          &lt;/TabItem&gt;
  
          &lt;TabItem Header="Manual Debug" Name="mainDTab" FontWeight="Bold" Visibility="Hidden"&gt;
              &lt;Canvas Background="DarkOrange" &gt;
                  &lt;TabControl Canvas.Left="0" Canvas.Top="0" Height="922" Name="debugControl" Width="1262" Padding="0"&gt;
  
                      &lt;TabItem Header="debug3" Name="debug1Tab" FontWeight="Bold"&gt;
                          &lt;Grid Background="LightSteelBlue"&gt;
                              &lt;usercontrols:debug3 x:Name="Control1" ScrollViewer.CanContentScroll="True" /&gt;
                          &lt;/Grid&gt;
                      &lt;/TabItem&gt;
  
                      &lt;TabItem Header="Name1" Name="debug2Tab" FontWeight="Bold"&gt;
                          &lt;Grid Background="LightSteelBlue"&gt;
                              &lt;usercontrols:debug4 x:Name="Control2" ScrollViewer.CanContentScroll="True" /&gt;
                          &lt;/Grid&gt;
                      &lt;/TabItem&gt;
  
                      &lt;TabItem Header="Nam2" Name="debug3Tab" FontWeight="Bold"&gt;
                          &lt;Grid Background="LightSteelBlue"&gt;
                              &lt;usercontrols:Name3 x:Name="Control3" ScrollViewer.CanContentScroll="True" /&gt;
                          &lt;/Grid&gt;
                      &lt;/TabItem&gt;
                  &lt;/TabControl&gt;
              &lt;/Canvas&gt;
          &lt;/TabItem&gt;
      &lt;/TabControl&gt;
  &lt;/Canvas&gt;
  </code></pre>
  
  <p></p>