I wrote a PasswordBox style.I want to do hint text in passwordbox but when the lost focus ,the hint text is appering.Where I'm doing mistake, How can I solve this problem?
Here is code:
 <Style TargetType="{x:Type PasswordBox}"  xmlns:sys="clr-namespace:System;assembly=mscorlib">
    <Style.Resources>
        <VisualBrush  x:Key="Bg1" AlignmentX="Center" AlignmentY="Center" Stretch="None" >
            <VisualBrush.Visual>
                <Label Content="Enter password" Foreground="LightGray" Margin="5,0,0,0"/>
            </VisualBrush.Visual>
        </VisualBrush>
        <VisualBrush  x:Key="Bg2" AlignmentX="Center" AlignmentY="Center" Stretch="None" >
            <VisualBrush.Visual>
                <Label Content="" Foreground="LightGray" Margin="5,0,0,0"/>
            </VisualBrush.Visual>
        </VisualBrush>
    </Style.Resources>
    <Setter Property="FontSize" Value="16"/>
    <Setter Property="Foreground" Value="#FF585858"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type PasswordBox}">
                <Border CornerRadius="2" x:Name="border" Background="{TemplateBinding Background}" BorderThickness="1" BorderBrush="LightGray">
                    <ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Visible" Margin="0" ScrollViewer.CanContentScroll="True" x:Name="PART_ContentHost"/>
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsFocused" Value="True">
                        <Setter Property="BorderBrush" TargetName="border" Value="#FFD0D0D0"/>
                        <Setter Property="BorderThickness" TargetName="border" Value="2"/>
                    </Trigger>
                    <DataTrigger Binding="{Binding Path=Password}" Value="{x:Static sys:String.Empty}">
                        <Setter Property="Background" Value="{StaticResource Bg2}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding Path=Password}" Value="{x:Null}">
                        <Setter Property="Background" Value="{StaticResource Bg1}" />
                    </DataTrigger>                      
                    <Trigger Property="IsKeyboardFocused" Value="True">
                        <Setter Property="Background" Value="White" />
                    </Trigger>                      
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>   
Thanks for your advice.