<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="StandardTextBox" TargetType="{x:Type TextBox}">
        <Setter Property="Background" Value="{DynamicResource TextBoxBackground}" />
        <Setter Property="CaretBrush" Value="{DynamicResource Foreground}" />
        <Setter Property="Foreground" Value="{DynamicResource Foreground}" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                        <ScrollViewer x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" Value="{DynamicResource TextBoxBackgroundSelected}" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="true">
                            <Setter Property="Background" Value="{DynamicResource TextBoxBackgroundSelected}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Validation.ErrorTemplate" Value="{DynamicResource ValidationErrorTemplate}" />
    </Style>

    <Style x:Key="SearchTextBox"
           BasedOn="{StaticResource StandardTextBox}"
           TargetType="{x:Type TextBox}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                        <TextBlock Name="search"
                                   Margin="5 0 0 0"
                                   VerticalAlignment="Center"
                                   Foreground="{DynamicResource SearchTextForeground}"
                                   Text="Search ..."
                                   Visibility="Hidden" />
                        <ScrollViewer x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="TextBox.Text" Value="">
                            <Setter TargetName="search" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="TextBox.Text" Value="{x:Null}">
                            <Setter TargetName="search" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" Value="{DynamicResource TextBoxBackgroundSelected}" />
                            <Setter TargetName="search" Property="Foreground" Value="{DynamicResource Foreground}" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="true">
                            <Setter Property="Background" Value="{DynamicResource TextBoxBackgroundSelected}" />
                            <Setter TargetName="search" Property="Visibility" Value="Hidden" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>