<Page
    x:Class="FlexPdfViewer.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FlexPdfViewer"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:fv="using:C1.Xaml.FlexViewer" 
    mc:Ignorable="d">

    <Page.Resources>
        <ResourceDictionary>
            <local:Strings x:Key="Strings"/>
        </ResourceDictionary>
    </Page.Resources>
    
    <Grid x:Name="layoutRoot" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        
        <fv:C1FlexViewer
            x:Name="flexViewer"
            />

        <ContentDialog 
            x:Name="passwordDialog"
            PrimaryButtonText="{Binding PasswordOpenLabel, Source={StaticResource Strings}}"
            SecondaryButtonText="{Binding PasswordCancelLabel, Source={StaticResource Strings}}"
            MaxWidth="{Binding ActualWidth, ElementName=layoutRoot}"
            >
            <StackPanel Padding="10, 0">
                <TextBlock
                    FontSize="24"
                    Text="{Binding PasswordTitleLabel, Source={StaticResource Strings}}"
                    TextWrapping="Wrap"
                    Padding="0, 20, 0, 10"
                    />
                <TextBlock
                    x:Name="fileNameBlock"
                    TextWrapping="Wrap"
                    Padding="0, 0, 0, 20"
                    />
                <PasswordBox
                    x:Name="passwordBox"
                    PasswordRevealMode="Hidden"
                    />
                <CheckBox
                    x:Name="revealModeCheckBox"
                    IsChecked="False" 
                    Content="{Binding ShowPasswordCheck, Source={StaticResource Strings}}"
                    Checked="CheckBox_Changed"
                    Unchecked="CheckBox_Changed"
                    />
            </StackPanel>

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