wpf responsive ListBox / Grid
<p>I am trying to recreate the following responsive grid (see 'Desired behavior' link below) in WPF. But, I am struggling to find the best way to achieve this.</p>

<p>Ideally, I would like a horizontal list of tiles that grow and shrink in size to fit the available space. As a starting point, I have a list box that wraps, but i'm left with white space when re-sizing.  Any pointers would be appreciated.</p>

<p>Current Wrap Panel: <br><br>
<img src="https://i.stack.imgur.com/AnBPl.png" alt="Current Wrap Panel"> :
<br><br></p>

<p><a href="http://www.dwuser.com/education/content/creating-responsive-tiled-layout-with-pure-css/" rel="nofollow noreferrer">Desired behavior</a></p>

<p>My current Code:</p>

<pre><code>&lt;Window x:Class="WrappingListbox.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Title="Wrapping Listbox"
    Width="525"
    Height="350"
    mc:Ignorable="d"&gt;
&lt;Grid&gt;

    &lt;ListBox x:Name="listbox1" ScrollViewer.VerticalScrollBarVisibility="Disabled"&gt;
        &lt;ListBox.ItemsPanel&gt;
            &lt;ItemsPanelTemplate&gt;
                &lt;WrapPanel IsItemsHost="True" Orientation="Vertical" /&gt;
            &lt;/ItemsPanelTemplate&gt;
        &lt;/ListBox.ItemsPanel&gt;
        &lt;ListBox.ItemTemplate&gt;
            &lt;DataTemplate&gt;
                &lt;StackPanel Margin="20" HorizontalAlignment="Center"&gt;
                    &lt;Viewbox&gt;
                        &lt;Grid x:Name="backgroundGrid"
                              Width="60"
                              Height="60"&gt;
                            &lt;Rectangle x:Name="Rect" Fill="green" /&gt;
                        &lt;/Grid&gt;
                    &lt;/Viewbox&gt;
                &lt;/StackPanel&gt;
            &lt;/DataTemplate&gt;
        &lt;/ListBox.ItemTemplate&gt;
    &lt;/ListBox&gt;


    &lt;WrapPanel HorizontalAlignment="Left" VerticalAlignment="Top" /&gt;


&lt;/Grid&gt;
</code></pre>

<p></p>