title: Width of child control should match width of parent container
body: <p>I'm pretty new to WPF. I often find my self struggling with getting a bunch of child controls combined width to match a given parent container.. As in the following:</p>
  
  <pre><code>&lt;ListBox x:Name="BrugereListBox" Grid.Column="0" Grid.Row="3" DataContext="{DynamicResource Brugere}" 
               ItemsSource="{Binding}" 
               PreviewMouseLeftButtonDown="BrugereListBox_MouseLeftButtonDown"
               PreviewMouseMove="BrugereListBox_PreviewMouseMove"
               &gt;
          &lt;ListBox.ItemTemplate  &gt;
              &lt;DataTemplate &gt;
                  &lt;Border BorderBrush="Black" BorderThickness="1" Margin="2"&gt;
                      &lt;StackPanel Orientation="Vertical" IsEnabled="True" 
                                  PreviewMouseLeftButtonDown="StackPanel_PreviewMouseLeftButtonDown"&gt;
                          &lt;StackPanel Orientation="Horizontal" &gt;
                              &lt;Label&gt;Navn&lt;/Label&gt;
                              &lt;TextBox Text="{Binding Name}"&gt;&lt;/TextBox&gt;
                          &lt;/StackPanel&gt;
                          &lt;StackPanel Orientation="Horizontal"&gt;
                              &lt;Label&gt;Password&lt;/Label&gt;
                              &lt;TextBox Text="{Binding Password}"&gt;&lt;/TextBox&gt;
                          &lt;/StackPanel&gt;
                          &lt;StackPanel Orientation="Horizontal"&gt;
                              &lt;Label&gt;Email&lt;/Label&gt;
                              &lt;TextBox Text="{Binding Email}"&gt;&lt;/TextBox&gt;
                          &lt;/StackPanel&gt;
                      &lt;/StackPanel&gt;
                  &lt;/Border&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListBox.ItemTemplate&gt;
      &lt;/ListBox&gt;
  </code></pre>
  
  <p>In this case I'm interested in getting the width of the children of the stackpanel:</p>
  
  <pre><code>&lt;StackPanel Orientation="Horizontal" &gt;
                          &lt;Label&gt;Navn&lt;/Label&gt;
                          &lt;TextBox Text="{Binding Name}"&gt;&lt;/TextBox&gt;
                      &lt;/StackPanel&gt;
  </code></pre>
  
  <p>to match the width of </p>
  
  <pre><code>&lt;ListBox x:Name="BrugereListBox"
  </code></pre>
  
  <p>Any generic solution to scenarios like this?</p>