Berryl
Berryl

Reputation: 12863

wpf MinHeight & Height

I am just going over some of the finer points in the project that Josh Smith included with his wonderful MSDN mvvm post and noticed that his MainWindow has both the MinHeight/Width and Height/Width properties to set to same values. Wouldn't he have accomplished the same thing by just setting the minimums?

Cheers,
Berryl

MinWidth="650" MinHeight="420" 
Width="650" Height="420"

Upvotes: 1

Views: 5594

Answers (1)

Quartermeister
Quartermeister

Reputation: 59149

If you don't set Width and Height then the Window will get a default size from the OS. It will still clamp it as described in WPF Windows Overview based on MinWidth, MinHeight, MaxWidth, MaxHeight, and SizeToContent, but the initial size can definitely be larger than MinWidth by MinHeight. You can try it yourself by creating a new WPF application and setting MinWidth and MinHeight to something small.

Upvotes: 1

Related Questions