title: How do I get windows taskbar height in WPF application?
body: <p>I am trying to get the <strong>height of windows taskbar</strong> from a WPF application. I got this  <a href="https://stackoverflow.com/questions/1264406/how-do-i-get-the-taskbars-position-and-size">How do I get the taskbar's position and size?</a> which shows how to find taskbar position but not the height. I got an answer from <a href="https://social.msdn.microsoft.com/Forums/vstudio/en-US/c7b7f8ed-9f58-416e-a6b8-539e9bbd40bd/how-can-i-get-the-height-of-the-windows-taskbar?forum=csharpgeneral" rel="nofollow noreferrer">how can i get the height of the windows Taskbar?</a> which says </p>
  
  <blockquote>
    <p>Use the Screen class.  The taskbar is the difference between its Bounds and WorkingArea properties.</p>
  </blockquote>
  
  <p>but no code example. If that is correct this should be the height of taskbar. Am I doing it right?</p>
  
  <pre><code>private int WindowsTaskBarHeight =&gt; Screen.PrimaryScreen.Bounds.Height - Screen.PrimaryScreen.WorkingArea.Height;
  </code></pre>