title: How to hide console window dynamically from a c# wpf application?
body: <p>i am running a c# wpf application as a console application so i have both ,a wpf and console window .</p>
  
  <p>i want the console window to hide on a button click in wpf window and reappear on another click .i don't want the window to close and open again,i just want to show/hide the window on button click so that i can see the debug messages when i click on the button .</p>
  
  <p>I asked the question about how to open/close the console window programatically , and here is the solution <a href="https://stackoverflow.com/questions/11600355/how-to-open-close-console-window-dynamically-from-a-wpf-application/11600466#11600466">How to open/close console window dynamically from a wpf application?</a> .
  But opening and closing gives me a exception every-time when the console window is cloase and  a console.writeline function is called .</p>