title: Flow icon view in WPF ListView
body: <p>I am new to WPF and as a learning project I opted for a Windows Explorer like File Manager. In this project I want to display the the List view as a icon list that follows flow layout pattern. I tried the solutions given here: <a href="https://stackoverflow.com/questions/484293/wpf-listview-with-icons-view">WPF: ListView with icons view?</a>. But they are making my icons overlap each other. My icons are basically user controls that are loaded dynamically. This is my code for user control that represents a list view icon:</p>
  
  <pre><code>&lt;UserControl x:Class="MVCP.FileItem"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
               mc:Ignorable="d" Height="156.767" Width="161.279"&gt;
      &lt;Grid HorizontalAlignment="Center"&gt;
          &lt;Image HorizontalAlignment="Center" Height="100" Margin="10,10,10,0" VerticalAlignment="Top" Width="141" Source="fileflat.png"/&gt;
          &lt;TextBlock HorizontalAlignment="Center" Margin="10,120,10,5" TextWrapping="Wrap" Text="&amp;lt;Filename&amp;gt;" VerticalAlignment="Center" Height="32" Width="141" FontSize="18" Foreground="White" TextAlignment="Center"/&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>And this is my ListView code:</p>
  
  <pre><code>&lt;ListView x:Name="files" Background="#FF19174B" AllowDrop="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" PreviewMouseLeftButtonDown="files_PreviewMouseLeftButtonDown" MouseMove="files_MouseMove"&gt;
      &lt;local:FileItem/&gt;
      &lt;local:FileItem/&gt;
      &lt;local:FileItem/&gt;
      &lt;local:FileItem/&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>How can I arrange these user controls so that they can look like Windows Explorer icons?</p>