<UserControl
    x:Class="AmbientSounds.Controls.SoundGridControl"
    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"
    xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
    d:DesignHeight="300"
    d:DesignWidth="400"
    mc:Ignorable="d">

    <Grid>
        <ScrollViewer>
            <muxc:ItemsRepeater
                x:Name="SoundsGridView"
                x:Uid="SoundsGridView"
                Margin="{x:Bind InnerMargin, Mode=OneWay}"
                ElementPrepared="OnElementPrepared"
                ItemTemplate="{x:Bind ItemTemplate, Mode=OneWay}"
                ItemsSource="{x:Bind ViewModel.Sounds}"
                Layout="{x:Bind Layout, Mode=OneWay}"
                TabFocusNavigation="Once" />
        </ScrollViewer>

        <muxc:ProgressRing
            x:Uid="SoundsLoadingRing"
            Width="40"
            Height="40"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Foreground="{ThemeResource DefaultTextForegroundThemeBrush}"
            IsActive="{x:Bind ViewModel.LoadCommand.IsRunning, Mode=OneWay}"
            Visibility="{x:Bind ViewModel.LoadCommand.IsRunning, Mode=OneWay}" />
    </Grid>
</UserControl>
