Question: I'm currently working on a WPF application which will run on Windows 8.1 tablet and I don't find any posts about the following issue :

My application needs to be full screen, so, I set for my views :

```
 WindowState="Maximized"
 WindowStyle="ToolWindow"

```

All right - my application will be displayed in full screen mode:
![](https://i.stack.imgur.com/lFYpB.png)

But, if I rotate the tablet a space is allocated and the application is not in full screen. 

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

I don't want this scenario to happen, the application should stay always in full screen.

I tried to listen SystemEvents.DisplaySettingsChanged event and manually set full screen:

```
SystemEvents.DisplaySettingsChanged += Current_SizeChanged;

private void Current_SizeChanged(object sender, EventArgs eventArgs)
{
    this.WindowStyle = WindowStyle.None;
    this.ResizeMode = ResizeMode.NoResize;
    this.WindowState = WindowState.Maximized;    
    this.UpdateLayout();
}

```

As you can see, i tried even to update layout, but still, not working!
What is strange, is the fact that if you start the application in any position but not in the normal one, it will work. For ex: if the application is started in portrait mode, rotation will not change the dimensions of the window, but if you run the application starting from landscape mode... the bug appears.

You can debug this issue using Ctrl + Alt + Arrows. 

Any suggestions?

**Edit:** It seems that the problem is caused by keyboard. The reserved zone is for keyboard, but i don't find a way to resize to full screen. Actual width, Width and Desired Width are all the same... 

**Edit2:** This bug can be reproduced only on Windows 8.1

Answer: 
I addition to the other answers I would like to note that when you pass a reference and use (aka dereference) that a lot in your function, it could be slower than making a copy.

This is because local variables to a function (usually) get loaded into the cache together, but when one of them is a pointer/reference and the function uses that, it could result in a cache miss. Meaning it needs to go to the (slower) main memory to get the pointed to variable, which could be slower than making the copy which is loaded in cache together with the function.

So even for 'small objects' it could be potentially faster to just pass by value.

(I read this in the very good book: [Computer Systems: a programmers perspective](http://csapp.cs.cmu.edu/))

Some more interesting discussion on the whole cache hit/miss topic: [How does one write code that best utilizes the CPU cache to improve performance?](https://stackoverflow.com/questions/763262/how-does-one-write-code-that-best-utilizes-the-cpu-cache-to-improve-performance)
I was taught:

* **Pass by value** when an argument variable is one of the fundamental built-in types, such as `bool`, `int`, or `float`. Objects of these types are so small that passing by reference doesn't result in any gain in efficiency. Also if you want to make a copy of a variable.
* **Pass a constant** reference when you want to efficiently pass a value that you don't need to change.
* **Pass a reference** only when you want to alter the value of the argument variable. But to try to avoid changing argument variables whenever possible.