title: Binding Listbox item source to a collection of collections in windows phone 7
body: <p>I am trying to bind a Listbox ItemSource to a collection of multiple Lists. i.e.</p>
  
  <p>List PersonCollection</p>
  
  <ul>
  <li><p>List Person</p></li>
  <li><p>List Collection</p></li>
  </ul>
  
  <p>Now I need to show items from both of these list. In wpf you could use HierarchicalDataTemplate i believe, but not sure how I can do it in windows phone 7. Tried with Blend and it generates the following data template.</p>
  
  <pre><code>&lt;DataTemplate x:Key="PersonDataTemplate"&gt;
      &lt;Grid&gt;
          &lt;StackPanel Margin="0,0,1,0" Orientation="Vertical" VerticalAlignment="Top"&gt;
              &lt;TextBlock Margin="0,0,1,0" TextWrapping="Wrap" Text="{Binding Person[0].Name}" d:LayoutOverrides="Width"/&gt;
              &lt;TextBlock Margin="0,0,1,0" TextWrapping="Wrap" Text="{Binding Collection[0].Total}" d:LayoutOverrides="Width"/&gt;
          &lt;/StackPanel&gt;
      &lt;/Grid&gt;
  &lt;/DataTemplate&gt; 
  
  &lt;ListBox Height="300" x:Name="personList" ItemsSource="{Binding PersonCollection}" Margin="10,0" ItemTemplate="{StaticResource PersonDataTemplate}"/&gt;
  </code></pre>
  
  <p>Is there another way I can do this? I have tried to set the DataContext of Textbox in DataTemplate to individual arrays but did not seem to work. Cant find anything similar on the net apart from the confirmation that HierarchicalDataTemplate is not supported in Windows Phone 7.</p>
  
  <p>I have other ways to do but none elegant..</p>
  
  <p>Thanks in advance.</p>
  
  <p>Regards</p>