title: Set the max height of wpf window based on available screen's size
body: <p>I have a WPF window which runs on multiple monitors having different resolutions. It'll be good but not required to be smart enough to change max height when I move the window from high-resolution monitor to low-resolution monitor or vice-versa.</p>
  
  <p>Current requirement is simple enough to set the max height of my modal window based on my current monitor's height.</p>
  
  <p>I have tested a few things like </p>
  
  <pre><code>Screen.PrimaryScreen.WorkingArea.Height
  Screen.PrimaryScreen.WorkingArea.Width
  </code></pre>
  
  <p>But it gives the height of only primary screen of system where I need the height of screen where window currently resides.</p>
  
  <p>Also a major concern in multiple monitors is the top property of windows, in high resolution monitors it is fine but in low-resolution or secondary monitors it starts from a different number like 160. </p>