title: WPF Avoid the size of the (main)window to be smaller than the content
body: <p>I have created a simple WPF application with following XAML code:</p>
  
  <pre><code>&lt;Window x:Class="WpfApplication1.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="MainWindow" Height="350" Width="525" SizeToContent="WidthAndHeight"&gt;
  &lt;Grid&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="Auto"/&gt;
          &lt;ColumnDefinition Width="Auto"/&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="Auto"/&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Button MinWidth="200" MinHeight="40" Content="Hello 1"/&gt;
      &lt;Button MinWidth="200" MinHeight="40" Content="Hello 2" Grid.Column="1"/&gt;
  
  &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>If I start the application I can resize the windows to a smaller size than the two buttons.</p>
  
  <p>As you can see I have used the MinWidth and MinHeight properties, but they didn't work.</p>
  
  <p>Please help me in this case.</p>
  
  <p>Regards,</p>
  
  <p>Thomas</p>