I'm making a Windows 8.1 C# app where there is a list of color blocks in a line. The number of colors can change, and I want the color blocks to fill up the width of the list control. I have tried using ItemsControl like this:

```
<ItemsControl Name="testGrid" HorizontalAlignment="Left" Margin="12,100,0,0" Width="220" Background="Black">
<ItemsControl.ItemTemplate>
    <DataTemplate>
        <Rectangle Fill="{Binding}" MinWidth="44" Height="44"/>
    </DataTemplate>
</ItemsControl.ItemTemplate>

```

I've tried GridView and ListView with item styles with HorizontalContentAlignment set to stretch as well. The main issue is that these are all vertical lists. I need a horizontal one.

If I try adding a StackPanel the stretched items stop working. Like this:

```
<ItemsControl.ItemsPanel>
   <ItemsPanelTemplate>
      <StackPanel Orientation="Horizontal" />
   </ItemsPanelTemplate>
</ItemsControl.ItemsPanel>

```

Here is an example image: 

![enter image description here](https://i.stack.imgur.com/zt9sa.jpg)

I'm using an item source bound to a List or Observable Collection. How would I go about achieving the effect in the image? Thanks