title: SL 4 -- Force redraw of visual tree
body: <p>Our application has a number of objects on a canvas; the canvas is contained in a scroll viewer.  We also have a slider control and some buttons, always centered at the top of the window.<br>
  I am trying to print the application by capturing a bitmap of the app, but without any 'decorations' -- slider, buttons, or scroll bars.  </p>
  
  <pre><code>        _scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden;
          _scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden;
          var s = xSlider;
          s.Visibility = Visibility.Collapsed;
          var b = xPlusButton;
          b.Visibility = Visibility.Collapsed;
          b = xMinusButton;
          b.Visibility = Visibility.Collapsed;
  
          b = xButton;
          b.Visibility = Visibility.Collapsed;
  </code></pre>
  
  <p>The slider and buttons are hidden, as expected, but the scrollbars are not.<br>
  I suspect the application needs to redraw the layout in order to hide the scrollbars.  Is there a way to make that happen?  This is made more complicated by the fact that the print operation in SL 4 must be initiated by a UI gesture; there is no way (AFAIK) to initiate programatically, so this redraw must happen in one of the PrintDocument event handlers.</p>
  
  <p>Thanks for any suggestions....</p>