When the following XAML used, the window size is not 5000x5000, but some small window where the button is cropped.
I can't find anything in MSDN that explicitly states what the size defaults are, but the Top
, Left
and WindowStartupLocation
property descriptions say that they default to the normal Win32 defaults if not specified. I think it's reasonable to assume that the Height
and Width
properties would do the same.
If you don't want this to happen for your window, then you must explicitly set either the Width
and Height
or the SizeToContent
property of the Window
element depending on your requirements. The explicit size you set on the Button
element will only have an effect on the Window
if Window.SizeToContent = True
.