Q:

ItemsControl inside wrappanel not using all available space

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.

                                                <TabItem Header="Game Sessions">
                        <Grid Margin="4,5,4,0">
                            <WrapPanel HorizontalAlignment="Stretch" Name="sessionsWrapPanel">
                                <Grid>
                                <ScrollViewer>
                                        <Grid>
                                <ItemsControl Name="listVideosSessions">

                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <materialDesign:Card Width="200" Margin="5,5,5,5">
                                                <Grid>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="140" />
                                                        <RowDefinition Height="*" />
                                                        <RowDefinition Height="Auto" />
                                                    </Grid.RowDefinitions>
                                                    <Image Source="{Binding sessionVideoThumbnail}" Height="140" Width="196" Stretch="UniformToFill" />
                                                    <Button Grid.Row="0" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 16 -20">
                                                        <materialDesign:PackIcon Kind="Bike" />
                                                    </Button>
                                                    <StackPanel Grid.Row="1" Margin="8 24 8 0">
                                                        <TextBlock FontWeight="Bold">
                                   <Run Text="{Binding sessionsVideoRecordDate}" />
                                                        </TextBlock>
                                                        <TextBlock TextWrapping="Wrap" VerticalAlignment="Center">
                                   <Run Text="{Binding sessionsVideoRecordtime}" />
                                                        </TextBlock>
                                                    </StackPanel>
                                                    <StackPanel HorizontalAlignment="Right" Grid.Row="2" Orientation="Horizontal" Margin="8">
                                                        <Button Style="{StaticResource MaterialDesignToolButton}" Width="30" Padding="2 0 2 0" materialDesign:RippleAssist.IsCentered="True">
                                                            <materialDesign:PackIcon Kind="ShareVariant" />
                                                        </Button>
                                                        <Button Style="{StaticResource MaterialDesignToolButton}" Width="30" Padding="2 0 2 0" materialDesign:RippleAssist.IsCentered="True">
                                                            <materialDesign:PackIcon Kind="Heart" />
                                                        </Button>
                                                        <materialDesign:PopupBox Style="{StaticResource MaterialDesignToolPopupBox}" Padding="2 0 2 0">
                                                            <StackPanel>
                                                                <Button Content="More" />
                                                                <Button Content="Options" />
                                                            </StackPanel>
                                                        </materialDesign:PopupBox>
                                                    </StackPanel>
                                                </Grid>
                                            </materialDesign:Card>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>
                                        </Grid>
                                    </ScrollViewer>
                                </Grid>
                            </WrapPanel>

                        </Grid>
                    </TabItem>

A:

It's not really clear what you are trying to achieve, but a scrollable ItemsControl that uses a WrapPanel for the layout of its items, should look like this:
<ItemsControl ItemsSource="{Binding ...}">
    <ItemsControl.Template>
        <ControlTemplate TargetType="ItemsControl">
            <ScrollViewer
                HorizontalScrollBarVisibility="Disabled"
                VerticalScrollBarVisibility="Auto">
                <ItemsPresenter/>
            </ScrollViewer>
        </ControlTemplate>
    </ItemsControl.Template>
    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <WrapPanel/>
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            ...
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>

