<?xml version="1.0" encoding="utf-8" ?>
<local:StartupPageControlBase
    x:Class="RodelAgent.UI.Controls.Startup.StartupAudioSection"
    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:ext="using:RodelAgent.UI.Extensions"
    xmlns:items="using:RodelAgent.UI.ViewModels.Items"
    xmlns:itemscontrol="using:RodelAgent.UI.Controls.Items"
    xmlns:local="using:RodelAgent.UI.Controls.Startup"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Padding="0,24" RowSpacing="8">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Spacing="8">
            <TextBlock
                HorizontalAlignment="Center"
                Style="{StaticResource SubtitleTextBlockStyle}"
                Text="{ext:Locale Name=OnlineAudioServices}" />
            <TextBlock
                MaxWidth="320"
                HorizontalAlignment="Center"
                Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                LineHeight="24"
                Text="{ext:Locale Name=OnlineAudioServicesDescription}"
                TextAlignment="Center"
                TextWrapping="Wrap" />
        </StackPanel>

        <Grid Grid.Row="1">
            <ProgressRing IsActive="{x:Bind ViewModel.IsOnlineAudioInitializing, Mode=OneWay}" Style="{StaticResource PageProgressRingStyle}" />
            <ScrollViewer
                Padding="32,0"
                Style="{StaticResource PageScrollViewerStyle}"
                Visibility="{x:Bind ViewModel.IsOnlineAudioInitializing, Mode=OneWay, Converter={StaticResource BoolToVisibilityReverseConverter}}">
                <Grid>
                    <ItemsRepeater ItemsSource="{x:Bind ViewModel.OnlineAudioServices}">
                        <ItemsRepeater.ItemTemplate>
                            <DataTemplate x:DataType="items:AudioServiceItemViewModel">
                                <itemscontrol:AudioServiceItemControl Click="OnItemClick" ViewModel="{x:Bind}" />
                            </DataTemplate>
                        </ItemsRepeater.ItemTemplate>
                        <ItemsRepeater.Layout>
                            <UniformGridLayout
                                ItemsStretch="Fill"
                                MinColumnSpacing="8"
                                MinItemHeight="48"
                                MinItemWidth="160"
                                MinRowSpacing="8" />
                        </ItemsRepeater.Layout>
                    </ItemsRepeater>
                </Grid>
            </ScrollViewer>
        </Grid>

    </Grid>
</local:StartupPageControlBase>
