title: wp7 c# get control data context
body: <p>I have a listbox whose item template is a user control:</p>
  
  <pre><code>&lt;ListBox
       x:Name="ChatBox"
       Width="450"
       ItemsSource="{Binding ChatMessage}"&gt;
            &lt;ListBox.ItemTemplate&gt;
                &lt;DataTemplate&gt;
                      &lt;local:ChatItem DataContext="{Binding ChatMessage}"/&gt;
                &lt;/DataTemplate&gt;
            &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>in my code behind:</p>
  
  <pre><code>messages = new ObservableCollection&lt;ChatMessage&gt;(dbMessages);
  ChatBox.ItemsSource = messages;
  </code></pre>
  
  <p>How can I get the bound element, that is, the chat message object from inside the control ?</p>
  
  <p>Thanks for help</p>