<UserControl
    x:Class="PDF_Office.CustomControl.NumericUpDown"
    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:local="clr-namespace:PDF_Office.CustomControl"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DesignHeight="32"
    d:DesignWidth="80"
    FontSize="20"
    mc:Ignorable="d">
    <Border>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="auto" />
            </Grid.ColumnDefinitions>
            <Border
                Background="{StaticResource color.field.bg.def}"
                BorderBrush="{StaticResource color.field.border.norm}"
                BorderThickness="1,1,0,1"
                CornerRadius="4,0,0,4" />
            <TextBox
                Name="TextBox_Num"
                MinWidth="80"
                MinHeight="32"
                Padding="16,0,0,0"
                VerticalContentAlignment="Center"
                Background="Transparent"
                BorderThickness="0"
                FontFamily="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontFamily}"
                FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontSize}"
                Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Foreground}"
                InputMethod.IsInputMethodEnabled="False"
                PreviewTextInput="CountTextBox_PreviewTextInput"
                Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Text}"
                TextAlignment="Left"
                TextChanged="TextBox_Num_TextChanged" />
            <Grid Grid.Column="1" Width="16">
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Border
                    Grid.Row="0"
                    Background="{StaticResource color.field.bg.def}"
                    BorderBrush="{StaticResource color.field.border.norm}"
                    BorderThickness="1,1,1,0.5"
                    CornerRadius="0,4,0,0">
                    <Button
                        Name="Button_Add"
                        Background="Transparent"
                        BorderBrush="Transparent"
                        BorderThickness="0"
                        Click="Button_Add_Click">
                        <Path
                            HorizontalAlignment="Center"
                            Data="M10 5.93571L13.9696 9.90532L15.0303 8.84466L10.5303 4.34472C10.2374 4.05183 9.76257 4.05183 9.46967 4.34472L4.96974 8.84466L6.0304 9.90532L10 5.93571Z"
                            Fill="{StaticResource color.icon.arrow.gray.def}"
                            Stretch="Uniform"
                            Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" />
                    </Button>
                </Border>
                <Border
                    Grid.Row="1"
                    Background="{StaticResource color.field.bg.def}"
                    BorderBrush="{StaticResource color.field.border.norm}"
                    BorderThickness="1,0.5,1,1"
                    CornerRadius="0,0,4,0">
                    <Button
                        Name="Button_Sub"
                        Background="Transparent"
                        BorderThickness="00"
                        Click="Button_Sub_Click">
                        <Path
                            Data="M10 9.06427L6.03039 5.09467L4.96973 6.15533L9.46967 10.6553C9.76256 10.9482 10.2374 10.9482 10.5303 10.6553L15.0303 6.15533L13.9696 5.09467L10 9.06427Z"
                            Fill="{StaticResource color.icon.arrow.gray.def}"
                            Stretch="Uniform"
                            Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" />
                    </Button>
                </Border>
            </Grid>
        </Grid>
    </Border>
</UserControl>