<Page
    x:Class="was.apple.mobiledevicebackup.DeviceBackupEncryptedPage"
    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"
    mc:Ignorable="d" Loaded="Page_Loaded"
    NavigationCacheMode="Enabled" MaxWidth="500">

    <Grid>
        <Grid.Resources>
            <Style TargetType="StackPanel">
                <Setter Property="HorizontalAlignment" Value="Center"/>
            </Style>
        </Grid.Resources>
        <StackPanel x:Name="stackPanelMain" Margin="0,100,0,40">
            <StackPanel x:Name="stackPanelEnterPassword" Margin="0">
                <TextBlock x:Uid="EncryptedBackup" Text="XX This Backup is Encrypted" Style="{ThemeResource SubheaderTextBlockStyle}" />
                <TextBlock x:Uid="EncryptedBackupInstructions" Margin="0,10,0,0" TextWrapping="Wrap" Text="XX Please enter your backup password."/>
                <TextBlock x:Uid="textBlockPasswordIncorrect" x:Name="textBlockPasswordIncorrect" Margin="0,10,0,0" Foreground="Red" Visibility="Collapsed"/>
                <PasswordBox x:Uid="PasswordBox" x:Name="textBoxPassword" PlaceholderText="XX Backup Password" Width="300" HorizontalAlignment="Left" Margin="0,10" KeyDown="TextBoxPassword_KeyDown" />
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,5,0,0">
                    <Button x:Uid="buttonCheckPassword"  Content="XX Check Password" x:Name="buttonCheckPassword" Click="ButtonCheckPassword_Click" Margin="0,0,10,0" Style="{StaticResource AccentButtonStyle}" />
                    <Button Grid.Column="2" x:Uid="buttonCancel" Content="XX Cancel" x:Name="buttonCancel" Click="ButtonCancel_Click"/>
                </StackPanel>

                <Grid Margin="0,30,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <FontIcon Glyph="&#xEA18;" FontSize="24" FontWeight="Bold" VerticalAlignment="Center" />
                    <TextBlock Grid.Column="1" TextWrapping="Wrap" Margin="10,0,0,0" FontStyle="Italic" VerticalAlignment="Center" x:Uid="TextBlockPasswordUsageDisclaimer"
                           Text="XX Your password is used only to locally decrypt your backup. It is not stored or sent to other services." />
                </Grid>

                <HyperlinkButton x:Name="linkButtonEncryptedBackupHelp" x:Uid="linkButtonEncryptedBackupHelp" Grid.Row="1" VerticalAlignment="Bottom"  
                             Margin="0,10,0,0" Content="XX Get Help with Encrypted Backups" NavigateUri="xx https://www.wideanglesoftware.com/support/ibackupextractor/does-ibackup-extractor-read-encrypted-backups.php"/>
            </StackPanel>

            <StackPanel Margin="0" x:Name="stackPanelTestingPassword" Visibility="Collapsed" Height="{Binding ActualHeight, ElementName=stackPanelEnterPassword, Mode=OneWay}">
                <TextBlock x:Uid="TextBlockVerifyingBackupPasswordTitle" Text="XX Verifying Backup Password" Style="{ThemeResource SubheaderTextBlockStyle}" />
                <TextBlock x:Name="textBlockVerifyingBackupPasswordLineOne" x:Uid="TextBlockVerifyingBackupPasswordLineOne" Text="XX TouchCopy is verifying that the entered backup password is correct. It will resume once the check is complete." Style="{ThemeResource BodyTextBlockStyle}"  Margin="0,10,0,0"/>
                <ProgressBar  IsIndeterminate="True" Margin="0,40,0,0" Width="300"/>
            </StackPanel>
        </StackPanel>
    </Grid>
</Page>
