title: WrapPanel does not wrap
body: <p>I have a WrapPanel inside a Window. In this case the controls inside the WrapPanel wrap when I manually resize the window.</p>
  
  <p>However, the initial width is too much. I have put all controls in a horizontal wrap panel.</p>
  
  <p>To make an initial width, I tried to set the Window to a width of 1000 (first try) and the wrappanel to 1000 (second try), but in this case the wrapping does not work anymore, only the 'border' (or padding) of the whole window is decreased or increased.</p>
  
  <p>How can I change the width (and height) of the window in such a way that when I manually resize, the wrapping is taken into account.</p>
  
  <p>Below a part of the XAML code:</p>
  
  <pre><code>Window x:Class="PcgTools.ListGenerator.ListGeneratorWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="{Binding ListGenerator, Source={StaticResource LocStrings}}" ResizeMode="CanResizeWithGrip"
      Icon="/PcgTools;component/Gui/pcgtools.ico" Loaded="Window_Loaded" Closed="Window_Closed"
      ShowInTaskbar="True" WindowStartupLocation="CenterOwner" SizeToContent="WidthAndHeight"&gt;
  &lt;WrapPanel Name="wrapPanel" Margin="4" Orientation="Horizontal"&gt;
  </code></pre>