title: Display items from a List<CustomObject> in a List View in a metro app
body: <p>I have a List. It is populated with CustomObjects when a query is run on a database (and matching results are put into this List)</p>
  
  <p>However, I then want to display each of the e.g. name properties of these resultant custom objects in a listview, this is the part that is causing me trouble.</p>
  
  <p>Im unsure how to set up the template of the list view to display the data from the list. The furthest I have been able to get is as follows: If the result of the query has 3 matches, I can make 3 textboxes saying "HELLO" appear in the list view. This is achieved by putting a textbox saying "HELLO" in the template part of the listview (which is otherwise laid out as it is in the grid template of VS2012). Is the solution something to do with bindings?</p>
  
  <p>Any help would be much appreciated. (working on a metro app, windows 8, .NET 4.5)</p>
  
  <p>what I currently have looks something like this</p>
  
  <pre><code>List&lt;CustomObject&gt; CustObjList =... //gets matches from database
  listView.ItemsSource = CustObjList;
  </code></pre>
  
  <p>then in the XAML is this</p>
  
  <pre><code>&lt;ListView.ItemTemplate&gt;
     &lt;DataTemplate&gt;
  
        &lt;UserControl Loaded="StartLayoutUpdates" Unloaded="StopLayoutUpdates"&gt;
             &lt;ScrollViewer x:Name="scrollViewer" Style="{StaticResource HorizontalScrollViewerStyle}" Grid.Row="1"&gt;
                  &lt;TextBlock x:Name="listViewText" Text="HELLO" &lt;--(???) Margin="30,0,0,0" Foreground="Black"/&gt;
  </code></pre>