<Border x:Class="GeekDesk.Control.Other.PasswordDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:hc="https://handyorg.github.io/handycontrol"
        xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
        CornerRadius="6"
        Width="300"
        Height="150"
        BorderThickness="0"
        >
    <Border.Resources>
        <Style x:Key="PassBox" TargetType="PasswordBox" BasedOn="{StaticResource PasswordBoxBaseStyle}">
            <Setter Property="Height" Value="40"/>
            <Setter Property="Width" Value="40"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="FontSize" Value="18"/>
            <Setter Property="Focusable" Value="True"/>
            <Setter Property="MaxLength" Value="1"/>
            <EventSetter Event="PasswordChanged" Handler="PasswordBox_PasswordChanged"/>
            <EventSetter Event="PreviewKeyDown" Handler="PasswordBox_KeyDown"/>
        </Style>
        <Style x:Key="NextTB" TargetType="TextBlock">
            <Setter Property="Foreground" Value="#408CCB"/>
            <Setter Property="TextDecorations" Value="Underline"/>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Foreground" Value="Red"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </Border.Resources>
    <Border.Background>
        <SolidColorBrush Color="White" Opacity="0.7"/>
    </Border.Background>
    <StackPanel VerticalAlignment="Center">
        <hc:UniformSpacingPanel Spacing="10"  VerticalAlignment="Center" HorizontalAlignment="Center">
            <TextBlock x:Name="Title" Text="请输入密码"
                       FontSize="15"/>
        </hc:UniformSpacingPanel>
        <Grid Height="65" x:Name="PasswordGrid" Visibility="Visible" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility}">
            <TextBlock x:Name="HintMsg"
                       Visibility="Hidden"
                       VerticalAlignment="Top" 
                       HorizontalAlignment="Center" 
                       Width="250" 
                       TextAlignment="Center" 
                       Margin="0,3,0,0" 
                       Text="提示:"
                       hc:Poptip.Content="{Binding ElementName=HintMsg, Path=Text}"
                       Foreground="Gray"/>
            <hc:UniformSpacingPanel Margin="0,20,0,0" Spacing="10"  VerticalAlignment="Center" HorizontalAlignment="Center">
                <PasswordBox x:Name="P1" Tag="P1" Style="{StaticResource PassBox}"/>
                <PasswordBox x:Name="P2" Tag="P2" Style="{StaticResource PassBox}"/>
                <PasswordBox x:Name="P3" Tag="P3" Style="{StaticResource PassBox}"/>
                <PasswordBox x:Name="P4" Tag="P4" Style="{StaticResource PassBox}"/>
            </hc:UniformSpacingPanel>
            <TextBlock HorizontalAlignment="Right"
                   x:Name="ErrorMsg"
                   Margin="0,65,37,-65" 
                   Foreground="Red" 
                   Text="密码输入错误"
                   Visibility="Visible"/>
        </Grid>
        <Grid Height="65" x:Name="HintGrid" Visibility="Collapsed" Margin="0,20,0,0" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeIn}, Event=Visibility}">
            <hc:UniformSpacingPanel Spacing="10"  VerticalAlignment="Top" HorizontalAlignment="Center">
                <hc:TextBox x:Name="HintBox" TextAlignment="Left" Width="220"/>
            </hc:UniformSpacingPanel>
            <hc:UniformSpacingPanel Spacing="10" Margin="202,35,0,0"  VerticalAlignment="Top" HorizontalAlignment="Left">
                <TextBlock Text="跳过" MouseLeftButtonDown="NextTB_MouseLeftButtonDown"  Style="{StaticResource NextTB}"/>
                <TextBlock Text="完成" MouseLeftButtonDown="DoneTB_MouseLeftButtonDown" Style="{StaticResource NextTB}"/>
            </hc:UniformSpacingPanel>
        </Grid>
    </StackPanel>
</Border>