<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:XamlTheme.Controls"
                    xmlns:themes="clr-namespace:XamlTheme">

    <Style TargetType="{x:Type controls:RestrictTextBox}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="#141414" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="Foreground" Value="#141414" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="MinHeight" Value="25" />
        <Setter Property="MinWidth" Value="40" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" />
        <Setter Property="SnapsToDevicePixels" Value="true" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:RestrictTextBox}">
                    <Grid Background="#00000000">
                        <Border x:Name="Base"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" >
                            <TextBox x:Name="PART_TextBox"  
                                     Padding="{TemplateBinding Padding}"
                                     MinHeight="{TemplateBinding MinHeight}"
                                     HorizontalAlignment="Stretch"
                                     VerticalAlignment="Stretch"
                                     HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                     VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" 
                                     TextAlignment="{TemplateBinding TextAlignment}"
                                     Background="{x:Null}"
                                     BorderThickness="0"
                                     FocusVisualStyle="{x:Null}"
                                     Focusable="{TemplateBinding Focusable}"
                                     FontFamily="{TemplateBinding FontFamily}"
                                     FontSize="{TemplateBinding FontSize}"
                                     Foreground="{TemplateBinding Foreground}"
                                     HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                                     IsReadOnly="{TemplateBinding IsReadOnly}"
                                     IsTabStop="{TemplateBinding IsTabStop}"
                                     SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                     TabIndex="{TemplateBinding TabIndex}"
                                     VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" 
                                     Style="{DynamicResource {x:Static themes:ResourceKeys.NormalTextBoxStyleKey}}"/>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsReadOnly" Value="True">
                            <Setter Property="Focusable" Value="False"/>
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" SourceName="PART_TextBox" Value="true">
                            <Setter Property="BorderBrush" Value="#007ACC"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>