title: How to make WPF listview display Images and Labels dynamically
body: <p>I'm having quite a difficult time trying to create the UI for a WPF Window. I'm trying to display (dynamically) a bunch of Movie Posters with the name of the movie directly under the image. ItemsSource is assigned to a list of Images via <code>foreach</code> iteration. The Image files themselves may be different sizes, but as shown below I will be setting a uniform size.</p>
  
  <p>Basically, my goal is for it to look something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/3fIHT.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/3fIHT.jpg" alt="enter image description here"></a> </p>
  
  <p>So far, My code only displays a window with one large horizontal row(?) with the image in the center and no label. Here's my XAML code:</p>
  
  <pre><code>&lt;Window x:Name="TVWindow" x:Class="PACS_Pre_Alpha.TV"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="TV" Height="746" Width="1000" ResizeMode="NoResize"&gt;
  &lt;Grid x:Name="TVGrid"&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="Auto"/&gt;
          &lt;RowDefinition /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;ListView x:Name="TvBox" HorizontalAlignment="Left" Height="648" VerticalAlignment="Top" Width="994" Grid.Row="5" Grid.Column="5"&gt;
          &lt;ItemsControl.ItemsPanel&gt;
              &lt;ItemsPanelTemplate&gt;
                  &lt;UniformGrid Columns="5" /&gt;
              &lt;/ItemsPanelTemplate&gt;
          &lt;/ItemsControl.ItemsPanel&gt;
          &lt;ListView.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;StackPanel Orientation="Vertical" VerticalAlignment="Stretch"&gt;
                      &lt;Image Source="{Binding ImageData}" HorizontalAlignment="Center" VerticalAlignment="Top" /&gt;
                      &lt;TextBlock Text="{Binding Title}" HorizontalAlignment="Center" VerticalAlignment="Bottom" /&gt;
                  &lt;/StackPanel&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListView.ItemTemplate&gt;
      &lt;/ListView&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>My movies are added with this C# code:</p>
  
  <pre><code>foreach (string tvf in ContentFiles)
  {
              string ContentTitle = System.IO.Path.GetFileNameWithoutExtension(tvf);
              MovieData cnt = new MovieData();
              cnt.ImageData = LoadImage(ActualImage);
              cnt.Title = ContentTitle;
              ContentDataList.Add(cnt);
  
  }
          TvBox.ItemsSource = ContentDataList;
  </code></pre>
  
  <p>Edit: I have changed my XAML Markup as @MarkFeldman suggested, but now nothing appears.
  Edit: It currently looks like this:
  <a href="https://i.stack.imgur.com/DmqV4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/DmqV4.png" alt="enter image description here"></a></p>