<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
                    xmlns:dhcc="http://www.dhcc.com.cn">
    <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
        <Setter Property="dhcc:FocusManager.FocusHandled" Value="{x:Static dhcc:TextBoxHelper.TextBoxFocusHandled}" />
        <Setter Property="dhcc:FocusManager.IsInternalKeyboardControlling" Value="True" />
        <Setter Property="dhcc:FocusManagerExt.IsFocusAdorner" Value="True" />
        <Setter Property="dhcc:PasswordBoxHelper.IsAutoSelectedAll" Value="True" />
        <Setter Property="dhcc:FocusManagerExt.AssertNotEmpty" Value="False" />
        <Setter Property="dhcc:FocusManagerExt.ValidationField" Value="Text" />
        <Setter Property="HorizontalAlignment" Value="{DynamicResource TextBox_Normal_HorizontalAlignment}" />
        <Setter Property="VerticalAlignment" Value="{DynamicResource TextBox_Normal_VerticalAlignment}" />
        <Setter Property="dhcc:FocusManagerExt.FieldEmptyPolicies">
            <Setter.Value>
                <dhcc:FieldPolicyCollection>
                    <dhcc:ShowTipPolicy />                   
                </dhcc:FieldPolicyCollection>
            </Setter.Value>
        </Setter>
        <Setter Property="dhcc:FocusManagerExt.RegexValidateErrorPolicies">
            <Setter.Value>
                <dhcc:FieldPolicyCollection>
                    <dhcc:ShowTipPolicy />                    
                </dhcc:FieldPolicyCollection>
            </Setter.Value>
        </Setter>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="Width" Value="120" />
        <Setter Property="Height" Value="23" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    <Grid>
                        <Border 
                          Name="Border"
                          CornerRadius="{DynamicResource TextBox_Normal_CornerRadius}" 
                          Padding="2"
                          Background="{DynamicResource TextBox_Normal_Background}"
                          BorderBrush="{DynamicResource TextBox_Normal_BorderBrush}"
                          BorderThickness="{DynamicResource TextBox_Normal_BorderThickness}" />
                        <Label Foreground="DimGray" 
                               x:Name="TextPrompt" 
                               Grid.Column="0"                                 
                               Opacity="0.5"
                               Content="{Binding Path=(dhcc:TextBoxHelper.WaterMarkText),RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=OneWay}"                                
                               Margin="3,0,0,0"
                               Visibility="Collapsed"
                               VerticalAlignment="Center"
                               Focusable="False"/>
                              
                        <ScrollViewer x:Name="PART_ContentHost"
                                      Margin="2,0,0,0"
                                      HorizontalAlignment="Stretch"
                                      VerticalAlignment="Stretch" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsFocused" Value="False"/>
                                <Condition Property="TextBox.Text" Value=""/>
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter Property="Visibility" TargetName="TextPrompt" Value="Visible"/>
                            </MultiTrigger.Setters>
                        </MultiTrigger>
                       
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background"  Value="{DynamicResource TextBox_MouseOver_Background}"/>
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource TextBox_MouseOver_BorderBrush}" />
                            <Setter TargetName="Border" Property="BorderThickness" Value="{DynamicResource TextBox_MouseOver_BorderThickness}"/>
                        </Trigger>
                        <Trigger Property="dhcc:FocusManagerExt.AssertNotEmpty" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource TextBox_AssertNotEmpty_Background}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource TextBox_Enable_Background}"/>
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource TextBox_Enable_BorderBrush}"/>
                            <Setter Property="Foreground" Value="{DynamicResource TextBox_Enable_Foreground}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>                   
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>