I have a simple MainWindow.xaml definition (most of it is default):
<Window x:Name="MyProj" x:Class="MyProj.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MyProj"
mc:Ignorable="d"
Title="MyProj" Width="1200" Height="900" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" />
Then I create the window in a code-behind with:
w = new MainWindow();
w.Show();
But when the Window appears upon app start it is slightly smaller than 1200x900. In fact to get a 1200x900 window I need to specify 1215x939 in the MainWindow.xaml.
At first I though I had to take the title bar and possible vertical scrollbar into consideration (!) but I don't have a scrollbar.
What's going on??