When the following XAML used, the window size is not 5000x5000, but some small window where the button is cropped.
I guess the OS has provided the window with these values. It might be related to how Windows OS remembers the size of any window before it was last closed.*
The same way I suppose windows provided a default height and width to your window when none of the dimensions where specified.