title: ItemsControl inside wrappanel not using all available space
body: <p>I have many elements inside an itemscontrol. This itemscontrol is inside a scrollviewer which is parented by a Wrappanel. With or without this scrollviewer, the elements will stack below eachother and never use all the available space. What am i doing wrong? The wrappanel is inside a grid.</p>
  <p><a href="https://i.stack.imgur.com/agWyc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/agWyc.png" alt="enter image description here" /></a></p>
  <pre><code>                                                &lt;TabItem Header=&quot;Game Sessions&quot;&gt;
                          &lt;Grid Margin=&quot;4,5,4,0&quot;&gt;
                              &lt;WrapPanel HorizontalAlignment=&quot;Stretch&quot; Name=&quot;sessionsWrapPanel&quot;&gt;
                                  &lt;Grid&gt;
                                  &lt;ScrollViewer&gt;
                                          &lt;Grid&gt;
                                  &lt;ItemsControl Name=&quot;listVideosSessions&quot;&gt;
  
                                      &lt;ItemsControl.ItemTemplate&gt;
                                          &lt;DataTemplate&gt;
                                              &lt;materialDesign:Card Width=&quot;200&quot; Margin=&quot;5,5,5,5&quot;&gt;
                                                  &lt;Grid&gt;
                                                      &lt;Grid.RowDefinitions&gt;
                                                          &lt;RowDefinition Height=&quot;140&quot; /&gt;
                                                          &lt;RowDefinition Height=&quot;*&quot; /&gt;
                                                          &lt;RowDefinition Height=&quot;Auto&quot; /&gt;
                                                      &lt;/Grid.RowDefinitions&gt;
                                                      &lt;Image Source=&quot;{Binding sessionVideoThumbnail}&quot; Height=&quot;140&quot; Width=&quot;196&quot; Stretch=&quot;UniformToFill&quot; /&gt;
                                                      &lt;Button Grid.Row=&quot;0&quot; Style=&quot;{StaticResource MaterialDesignFloatingActionMiniAccentButton}&quot; HorizontalAlignment=&quot;Right&quot; VerticalAlignment=&quot;Bottom&quot; Margin=&quot;0 0 16 -20&quot;&gt;
                                                          &lt;materialDesign:PackIcon Kind=&quot;Bike&quot; /&gt;
                                                      &lt;/Button&gt;
                                                      &lt;StackPanel Grid.Row=&quot;1&quot; Margin=&quot;8 24 8 0&quot;&gt;
                                                          &lt;TextBlock FontWeight=&quot;Bold&quot;&gt;
                                     &lt;Run Text=&quot;{Binding sessionsVideoRecordDate}&quot; /&gt;
                                                          &lt;/TextBlock&gt;
                                                          &lt;TextBlock TextWrapping=&quot;Wrap&quot; VerticalAlignment=&quot;Center&quot;&gt;
                                     &lt;Run Text=&quot;{Binding sessionsVideoRecordtime}&quot; /&gt;
                                                          &lt;/TextBlock&gt;
                                                      &lt;/StackPanel&gt;
                                                      &lt;StackPanel HorizontalAlignment=&quot;Right&quot; Grid.Row=&quot;2&quot; Orientation=&quot;Horizontal&quot; Margin=&quot;8&quot;&gt;
                                                          &lt;Button Style=&quot;{StaticResource MaterialDesignToolButton}&quot; Width=&quot;30&quot; Padding=&quot;2 0 2 0&quot; materialDesign:RippleAssist.IsCentered=&quot;True&quot;&gt;
                                                              &lt;materialDesign:PackIcon Kind=&quot;ShareVariant&quot; /&gt;
                                                          &lt;/Button&gt;
                                                          &lt;Button Style=&quot;{StaticResource MaterialDesignToolButton}&quot; Width=&quot;30&quot; Padding=&quot;2 0 2 0&quot; materialDesign:RippleAssist.IsCentered=&quot;True&quot;&gt;
                                                              &lt;materialDesign:PackIcon Kind=&quot;Heart&quot; /&gt;
                                                          &lt;/Button&gt;
                                                          &lt;materialDesign:PopupBox Style=&quot;{StaticResource MaterialDesignToolPopupBox}&quot; Padding=&quot;2 0 2 0&quot;&gt;
                                                              &lt;StackPanel&gt;
                                                                  &lt;Button Content=&quot;More&quot; /&gt;
                                                                  &lt;Button Content=&quot;Options&quot; /&gt;
                                                              &lt;/StackPanel&gt;
                                                          &lt;/materialDesign:PopupBox&gt;
                                                      &lt;/StackPanel&gt;
                                                  &lt;/Grid&gt;
                                              &lt;/materialDesign:Card&gt;
                                          &lt;/DataTemplate&gt;
                                      &lt;/ItemsControl.ItemTemplate&gt;
                                  &lt;/ItemsControl&gt;
                                          &lt;/Grid&gt;
                                      &lt;/ScrollViewer&gt;
                                  &lt;/Grid&gt;
                              &lt;/WrapPanel&gt;
  
                          &lt;/Grid&gt;
                      &lt;/TabItem&gt;
  </code></pre>