I am trying to get the height of windows taskbar from a WPF application. I got this How do I get the taskbar's position and size? which shows how to find taskbar position but not the height. I got an answer from how can i get the height of the windows Taskbar? which says
Use the Screen class. The taskbar is the difference between its Bounds and WorkingArea properties.
but no code example. If that is correct this should be the height of taskbar. Am I doing it right?
private int WindowsTaskBarHeight => Screen.PrimaryScreen.Bounds.Height - Screen.PrimaryScreen.WorkingArea.Height;