title: WPF Custom Control with Item/Data Templates
body: <p>I know how to create a custom user control in WPF but how can I make it so that someone can provide an ItemTemplate?</p>
  
  <p>I have a user control that is a mixture of several other WPF controls, one of them being a ListBox. I'd like to let the user of the control specify the content of the list box but I'm not sure how to pass that information through.</p>
  
  <p>EDIT: The accepted answer works with the following correction:</p>
  
  <pre><code>&lt;UserControl x:Class="WpfApplication6.MyControl"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:src="clr-namespace:WpfApplication6"&gt;
      &lt;ListBox ItemTemplate="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type src:MyControl}}, Path=ItemsSource}" /&gt;
  &lt;/UserControl&gt;
  </code></pre>