title: How to add controls dynamically to a UserControl through user's XAML?
body: <p>I want to create a user control that contains a TextBlock and a StackPanel that will allow the user to add his/her own controls to the user control dynamically in XAML.</p>
  
  <p>Here is the sample XAML for my UserControl:</p>
  
  <pre><code>&lt;UserControl x:Class="A1UserControlLibrary.UserControlStackPanel"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
               mc:Ignorable="d" 
               d:DesignHeight="200" d:DesignWidth="300"&gt;
      &lt;StackPanel&gt;
          &lt;TextBlock Text="I want the user to be able to add any number of controls to the  StackPanel below this TextBlock."
                     FontFamily="Arial" FontSize="12" FontWeight="DemiBold" Margin="5,10,5,10" TextWrapping="Wrap"/&gt;
          &lt;StackPanel&gt;
              &lt;!-- I want the user to be able to add any number of controls here --&gt;
          &lt;/StackPanel&gt;
      &lt;/StackPanel&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>I would like the user to be able to embed this user control in their XAML and add their own controls to the stack panel of the user control:</p>
  
  <pre><code>&lt;uc:A1UserControl_StackPanel x:Name="MyUserControl_Test" Margin="10" Height="100"&gt;
      &lt;Button Name="MyButton1" Content="Click" Height="30" Width="50"/&gt;
      &lt;Button Name="MyButton2" Content="Click" Height="30" Width="50"/&gt;
      &lt;Button Name="MyButton3" Content="Click" Height="30" Width="50"/&gt;
  &lt;/uc:A1UserControl_StackPanel&gt;
  </code></pre>
  
  <p>Doing this using the above XAML does not work.  Any ideas?</p>