title: How can I force ListBoxItems to display inline in XAML
body: <pre><code>&lt;ListBox Background="Black" ScrollViewer.VerticalScrollBarVisibility="Auto"&gt;
      &lt;ListBox.ItemsPanel&gt;
          &lt;ItemsPanelTemplate&gt;
              &lt;StackPanel Orientation="Horizontal"/&gt;
          &lt;/ItemsPanelTemplate&gt;
      &lt;/ListBox.ItemsPanel&gt;
      &lt;ListBoxItem Background="White" Width="150" Height="200" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5"&gt;Item0&lt;/ListBoxItem&gt;
      &lt;ListBoxItem Background="White" Width="150" Height="200" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5"&gt;Item1&lt;/ListBoxItem&gt;
      &lt;ListBoxItem Background="White" Width="150" Height="200" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5"&gt;Item2&lt;/ListBoxItem&gt;
      &lt;ListBoxItem Background="White" Width="150" Height="200" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5"&gt;Item3&lt;/ListBoxItem&gt;
      &lt;ListBoxItem Background="White" Width="150" Height="200" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5"&gt;Item4&lt;/ListBoxItem&gt;
      &lt;ListBoxItem Background="White" Width="150" Height="200" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5"&gt;Item5&lt;/ListBoxItem&gt;
      &lt;ListBoxItem Background="White" Width="150" Height="200" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5"&gt;Item6&lt;/ListBoxItem&gt;
      &lt;ListBoxItem Background="White" Width="150" Height="200" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5"&gt;Item7&lt;/ListBoxItem&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>This code above produces this Image below.
  <a href="https://i.stack.imgur.com/EX5m0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EX5m0.png" alt="enter image description here"></a></p>
  
  <p>But I want to create something like this image below. Where the box breaks down to the next line at the end of it's parent control. And I want to achieve this using XAML (and C# if required)
  <a href="https://i.stack.imgur.com/dlLNu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dlLNu.jpg" alt="enter image description here"></a></p>