The Window_SizeChanged event handler in my application reports the wrong size in SizeChangedEventArgs.NewSize. Also, changing the WindowStyle to "None" (no border) decreased the size instead of increasing it.
I was able to reproduce this by creating a default WPF application and adding a handler for SizeChanged to the Window.
In particular, my monitor resolution is 1920x1080.
At 100% = 96 DPI, when maximizing the window I expected this size but get 1934x1094 for style "None" and 1936x1056 otherwise.
And at 125% = 120 DPI, I would expect a size 4/5 the resolution which is 1536x864, but get size 1548.4x876.8 for style "None" and 1550.4x840.0 otherwise.
A similar issue, WPF Maximized Window bigger than screen asks why the size of the window is reported to be larger than the screen when maximizing, but this happens for any window style. Also, that report does not have an accepted answer or one that handles multiple monitors or other window styles.
It's not explained by taking into account the border and caption because the window size should not be greater than the screen, and because the border is not 7 pixels thick.
So what's wrong with my size calculations? Why does it give a larger size when the window has a border? As a result, I am not able to correctly fit and scale a component in my application.