The problem is that your WrapPanel
only has a single child: The ListBox
. This means that the layouting is done by the ItemsPanel
template of the ListBox
.
Try this instead:
<Expander Header="{Binding GroupName}" Style="{DynamicResource FeatureExpander2}">
<ListBox x:Name="ListOfTiles" ItemsSource="{Binding VideoSamples}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Width="120" Margin="10" HorizontalAlignment="Left">
<Image />
<TextBlock />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</Expander>