<Page
    x:Class="was.touchcopy.features.settings.SettingsUpdatePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:was.touchcopy.features.settings"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DataContext="{d:DesignInstance local:SettingsUpdatePage}">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid Padding="20,10">
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <TextBlock x:Uid="UpdateSettings" Style="{ThemeResource TitleTextBlockStyle}" Margin="0,10,0,20" Text="XX Updates"/>
            <TextBlock Grid.Row="1" x:Uid="TextBlockUpdateStartupSettings" Style="{ThemeResource SubtitleTextBlockStyle}" Text="XX Start-up Settings" Margin="0,0,0,15"/>

            <ToggleSwitch Grid.Row="2" x:Uid="toggleSwitchCheckUpdates" x:Name="toggleSwitchCheckUpdates" OffContent="XX Check for updates on start-up."
                          OnContent="XX Checking for updates on start-up" Toggled="toggleSwitchCheckUpdates_Toggled" Margin="0,0,0,0"/>

            <!-- Checking -->
                <Grid Grid.Row="3" x:Name="gridChecking" Visibility="Visible" Margin="30">
                    <StackPanel >
                        <TextBlock x:Uid="TextBlockCheckingForUpdates" Text="XX Checking for Updates..." FontWeight="SemiBold" FontSize="14"/>
                        <ProgressBar IsIndeterminate="True" Height="16" Margin="0,10,0,0"/>
                    </StackPanel>
                </Grid>

                <!-- No Updates Available -->
            <Grid Grid.Row="3" x:Name="gridNoUpdates" Visibility="Collapsed"  Margin="30">
                    <StackPanel>
                        <TextBlock x:Uid="TextBlockNoUpdatesAvailable" Text="XX No updates currently available." Style="{ThemeResource SubtitleTextBlockStyle}" />
                        <TextBlock x:Name="textBlockLastChecked" Style="{ThemeResource CaptionTextBlockStyle}" />
                    </StackPanel>
                </Grid>

                <!-- Updates Available -->
                <Grid Grid.Row="3" x:Name="gridUpdatesAvailable" Visibility="Collapsed" Margin="30" >
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.Resources>
                    <Style x:Key="texBlockStyle" TargetType="TextBlock">
                        <Setter Property="FontSize" Value="14"/>
                        <Setter Property="Margin" Value="0,0,0,7"/>
                    </Style>
                </Grid.Resources>
                <StackPanel Orientation="Horizontal"  Background="{ThemeResource AppBarBackgroundThemeBrush}" Padding="10">
                        <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xF133;" FontSize="36" VerticalAlignment="Top"/>
                        <StackPanel Margin="7,0,0,0">
                            <TextBlock x:Uid="TextBlockAnUpdateIsAvailable" Text="XX An update is available." Style="{ThemeResource SubtitleTextBlockStyle}" FontWeight="SemiBold" Margin="12,4,0,7"/>
                            <HyperlinkButton x:Uid="HyperlinkButtonDownloadUpdate" Content="XX Click here to download this update" NavigateUri="{Binding UpdateUrl, Mode=OneWay}"/>
                        </StackPanel>
                    </StackPanel>
                    <WebView2 x:Name="webViewReleaseNotes"  Grid.Row="1" Margin="-10,20,0,0" MinHeight="300"  />
                </Grid>

        </Grid>
    </Grid>
</Page>
