title: ItemControl DataTemplate with UIElement list
body: <p>I'm trying to develop library of user controls that arranges multiple UIElements in specific way. I use ItemControl to show list of UIElements. I want to surround every item from item control with Stack.
  I would like to use my library more or less this manner.</p>
  
  <pre><code>  &lt;pcLayouts:ListLayout&gt;
  
        &lt;pcLayouts:ListLayout.ParentItems&gt;
            &lt;TextBlock Width="145"&gt;1&lt;/TextBlock&gt;
            &lt;TextBlock&gt;2&lt;/TextBlock&gt;
            &lt;TextBlock&gt;3&lt;/TextBlock&gt;
        &lt;/pcLayouts:ListLayout.ParentItems&gt;
  
     &lt;/pcLayouts:ListLayout&gt;
  
  
  </code></pre>
  
  <p>I declared dependency property in backing class ListLayout cs and xaml files.</p>
  
  <pre><code>        public static readonly DependencyProperty ParentItemsProperty = DependencyProperty.Register(
              "ParentItems", typeof(ObservableCollection&lt;UIElement&gt;), typeof(ColumnLayout),
              new PropertyMetadata(new ObservableCollection&lt;UIElement&gt;()));
  ...
          public ObservableCollection&lt;UIElement&gt; ParentItems
          {
              get { return (ObservableCollection&lt;UIElement&gt;)GetValue(ParentItemsProperty); }
              set
              {
                  SetValue(ParentItemsProperty, value);
                  OnPropertyChanged();
              }
          }
  </code></pre>
  
  <pre><code>    &lt;StackPanel x:Name="MainPanel" Orientation="Vertical"&gt;
          &lt;ItemsControl ItemsSource="{Binding ParentItems, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}" &gt;
              &lt;ItemsControl.ItemsPanel&gt;
                  &lt;ItemsPanelTemplate&gt;
                      &lt;WrapPanel /&gt;
                  &lt;/ItemsPanelTemplate&gt;
              &lt;/ItemsControl.ItemsPanel&gt;
              &lt;ItemsControl.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                          &lt;WHAT SHOULD I PUT HERE??/&gt;
                  &lt;/DataTemplate&gt;
              &lt;/ItemsControl.ItemTemplate&gt;
          &lt;/ItemsControl&gt;
      &lt;/StackPanel&gt;
  </code></pre>
  
  <p>It seems DataTemplate isn't used at all when binding to <code>Binding ParentItems, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}</code>. How can I use this data template or is there another way?</p>