well I have googled it and got some answers, asked many times, answered many times. as I read viewport is the "inside window" So I have 2 integers, height and width and this code:
heightofwindow = graphicsDevice.Viewport.Bounds.Height; widtthofwindow = graphicsDevice.Viewport.Bounds.Width;
However, I get the error. It doesnt matter if I put it under update or draw. This seems like a more of language problem due to my limited knowlodge.
Object reference not set to an instance of an object.