title: WPF: Problem with ItemsControl datatemplate as a user control
body: <p>This works fine:</p>
  
  <pre><code> &lt;ItemsControl ItemsSource="{Binding Persons}"&gt;
     &lt;ItemsControl.ItemsPanel&gt;
       &lt;ItemsPanelTemplate&gt;
         &lt;StackPanel Orientation="Vertical" /&gt;
       &lt;/ItemsPanelTemplate&gt;
     &lt;/ItemsControl.ItemsPanel&gt;
     &lt;ItemsControl.ItemTemplate&gt;
       &lt;DataTemplate&gt;
         &lt;StackPanel Orientation="Horizontal"&gt;
           &lt;TextBlock Text="{Binding Path=FirstName}"/&gt;
           &lt;TextBlock Text="{Binding Path=LastName}"/&gt;
         &lt;/StackPanel&gt;
       &lt;/DataTemplate&gt;
     &lt;/ItemsControl.ItemTemplate&gt;
   &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>But, I want to make use of a User Control in place of the stack panel with two TextBlocks using something like:</p>
  
  <pre><code>  &lt;DataTemplate&gt;
      &lt;jasControls:NameView/&gt;
    &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>But, with this and a million other syntaxes, the NameView shows nothing, yet it works fine in a separate test, outside the ItemsControl, with explicitly set (dependency) property - e.g.</p>
  
  <pre><code>  &lt;jasControls:NameView FName="{Binding Path=Person.FirstName}"  /&gt;
  </code></pre>
  
  <p>I can find hardly any examples of this anywhere, and need to know how to specify the properties of the user control - or how can the user control 'receive' the individual item type (a Person)? What syntax to use? Do I need to specify the datatype? Is ItemsControl causing a problem or should any similar control do e.g. ListBox? Can I design it so that the user control gets an entire Person object? What dependency properties do I need in the user control? In short, how to get data into the user control?! The actual business types involved will be a bit more complicated involving some logic in the user control, hence my desire to use a user control.</p>
  
  <p>ANY direction on this will be very gratefully received - TIA</p>