Question: I think there is a bug with the Window.Width and Window.Height of wpf. I need my window to cover my entire desktop (there are two monitors) but first let me show you why I think there is a bug.

First let me show you the resolution of my monitors: (both have the same resolution)
------------------------------------------------------------------------------------

![enter image description here](https://i.stack.imgur.com/1dNvt.png)

this is the window on visual studio that I am working with
----------------------------------------------------------

![enter image description here](https://i.stack.imgur.com/mYXyc.png)

I don't know if you guys know AutoIt but it is a nice program to automate simple stuff. so if I want to resize my MainWindow to cover all the space in my first monitor (same thing as if I where maximizing a window) I will execute this method on autoit:
![enter image description here](https://i.stack.imgur.com/NJ7Yg.png)

and when I execute that code my window that I am creating in visual studio extends and it appears exactly as if it where to be maximized. 

![enter image description here](https://i.stack.imgur.com/xLuJU.png)

so far the coordinates seem to be working. 

now when I do the same thing with c# on wpf:

---

```
    public static void setWindowSize(System.Windows.Window w)
    {
        w.Left = 0;
        w.Top =0;
        w.Width = 1920;
        w.Height = 1079;
    }

```

The parameter w will be the MainWindow. When I execute that take a look how the window get's resized:
![enter image description here](https://i.stack.imgur.com/YDalw.png)

I placed the older image next to it so that you guys can compare it. Why are the dimensions not the same? I belive that the Window.Width and Window.Height properties do not work correctly. or what am I doing wrong?

Answer: 
If you want to cover your main monitor then

`Width = SystemParameters.PrimaryScreenWidth, Height = SystemParameters.PrimaryScreenHeight`

if you want to cover both monitors

`Width = SystemParameters.VirtualScreenWidth, Height = SystemParameters.VirtualScreenHeight`
try out this

Width = SystemParameters.PrimaryScreenWidth,
 Height = SystemParameters.PrimaryScreenHeight,