title: traversing the xaml document programmatically
body: <p>I have the following xaml:</p>
  
  <pre><code>&lt;phone:PivotItem Header="MESSAGES" x:Name="Messages"&gt;
      ...
      &lt;ListBox x:Name="MessagesStreamList"&gt;
          &lt;ListBox.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;Grid x:Name="ParticipantImages"&gt;
                  &lt;/Grid&gt;
  </code></pre>
  
  <p>How do I traverse programmatically to get a hold of <code>ParticipantImages</code> so I can programmatically add columns etc?</p>
  
  <p>I do not have direct access to <code>ParticipantImages</code></p>
  
  <p><strong>---------EDIT-----------</strong></p>
  
  <p>I just tried using the VisualTreeHelper:</p>
  
  <pre><code>int poop = VisualTreeHelper.GetChildrenCount(MessagesStreamList);
  </code></pre>
  
  <p>but this returns a count of <strong>0</strong>.</p>
  
  <p>Is this something to do with the ItemTemplate again?</p>