<UserControl x:Class="ControlExplorer.Controls.PdfViewer.DemoPDFViewer"
    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"
    xmlns:c1Pdf="using:C1.Xaml.PdfViewer"
    d:DesignHeight="480" d:DesignWidth="480">

    <Grid x:Name="LayoutRoot">
        <Grid x:Name="gridViewer" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>


            <Grid Grid.Row="0" x:Name="panelFindText" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Button x:Name="btnClose" Content="X" Click="btnClose_Click" BorderThickness="0" MinWidth="30" />
                <TextBox x:Name="txtSearch" TextChanged="txtSearch_TextChanged" Grid.Column="1"  VerticalAlignment="Center" Margin="5 0"/>
                <Button Content="next" Click="btnDoSearch_Click" x:Name="btnDoSearch" Grid.Column="2" />
            </Grid>

            <Grid Grid.Row="1">
                <TextBlock x:Name="txtLoading" Text="Loading..." VerticalAlignment="Center" HorizontalAlignment="Center" />

                <c1Pdf:C1PdfViewer x:Name="pdfViewer" ViewMode="Fitted" Visibility="Collapsed" Zoom="0.75" ViewportGap="1.0" SelectionBackground="#7FFF8040" />

                <Border VerticalAlignment="Top" HorizontalAlignment="Left" 
                    Background="{StaticResource PhoneChromeBrush}"
                    CornerRadius="5" Opacity="0.8" Margin="5" Grid.Row="1" >
                    <StackPanel Orientation="Horizontal" Margin="4" >
                        <TextBlock FontSize="16" Text="{Binding ElementName=pdfViewer, Path=PageNumber}" Foreground="{StaticResource PhoneForegroundBrush}" />
                        <TextBlock FontSize="16" Text=" / " Foreground="{StaticResource PhoneForegroundBrush}" />
                        <TextBlock FontSize="16" Text="{Binding ElementName=pdfViewer, Path=PageCount}" Foreground="{StaticResource PhoneForegroundBrush}" />
                    </StackPanel>
                </Border>
            </Grid>
        </Grid>

        <Grid x:Name="gridPickFiles" Visibility="Collapsed" >
            <ListBox x:Name="listFiles" SelectionChanged="listFiles_SelectionChanged" FontSize="40" FontFamily="Segoe WP" Padding="30" />
        </Grid>

    </Grid>
</UserControl>
