<UserControl
    x:Class="PDF_Master.CustomControl.PaginationControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:cus="clr-namespace:PDF_Master.CustomControl"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="clr-namespace:PDF_Master.CustomControl"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Height="36"
    d:DesignHeight="450"
    Foreground="{StaticResource color.sys.text.anti.norm}"
    mc:Ignorable="d">
    <Border Background="{StaticResource color.sys.layout.dark.bg}" CornerRadius="{StaticResource radius.base.m}">
        <Grid
            Margin="16,6"
            HorizontalAlignment="Stretch"
            Background="Transparent">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto" />
                <ColumnDefinition Width="auto" />
                <ColumnDefinition Width="auto" />
            </Grid.ColumnDefinitions>
            <Grid>
                <cus:TextBoxEx
                    x:Name="TxtInput"
                    Width="50"
                    Height="24"
                    CornerRadius="4"
                    Foreground="{StaticResource color.field.text.act}"
                    InputMethod.IsInputMethodEnabled="False"
                    LostFocus="TxtInput_LostFocus"
                    PreviewKeyDown="TxtInput_PreviewKeyDown"
                    ShowClose="False"
                    Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:PaginationControl}, Path=InputString, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                    Visibility="Collapsed" />
                <TextBlock
                    Name="TblIndex"
                    MinWidth="15"
                    VerticalAlignment="Center"
                    PreviewMouseDown="TblIndex_PreviewMouseDown"
                    Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:PaginationControl}, Path=CurrentPage, StringFormat={}{0}}"
                    TextAlignment="Center" />
            </Grid>
            <TextBlock
                Grid.Column="1"
                Margin="8,0"
                VerticalAlignment="Center"
                FontSize="12"
                Text="/" />
            <TextBlock
                Name="TBPageCount"
                Grid.Column="2"
                VerticalAlignment="Center"
                FocusVisualStyle="{x:Null}"
                Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:PaginationControl}, Path=PageCount, StringFormat={}{0}}" />
        </Grid>
    </Border>
</UserControl>