title: Printing hidden window in WPF
body: <p>I have a Window object I'd like to create, set some values on, and then send straight to the printer without showing it. I thought this was the right stuff to do it, but shows a blank doc. </p>
  
  <pre><code>PrintDialog dlg = new PrintDialog();
  
  ReportWindow rw = new ReportWindow(); //WPF Window object
  
  var sz = new Size(96*8.5, 96*11);     //size of a paper page, 8.5x11
  
  rw.Measure(sz); rw.Arrange(new Rect(sz)); 
  
  //   rw.Show();  //want to keep it hidden
  
  dlg.PrintVisual(rw, "report printout");
  
  rw.Close(); 
  </code></pre>
  
  <p>To verify the printing code is ok, i put it inside the form Loaded event, call Show(), and it works fine. </p>