PasswordDialog.xaml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <Border x:Class="GeekDesk.Control.Other.PasswordDialog"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:hc="https://handyorg.github.io/handycontrol"
  5. xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
  6. CornerRadius="6"
  7. Width="300"
  8. Height="150"
  9. BorderThickness="0"
  10. >
  11. <Border.Resources>
  12. <Style x:Key="PassBox" TargetType="PasswordBox" BasedOn="{StaticResource PasswordBoxBaseStyle}">
  13. <Setter Property="Height" Value="40"/>
  14. <Setter Property="Width" Value="40"/>
  15. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  16. <Setter Property="VerticalContentAlignment" Value="Center"/>
  17. <Setter Property="FontSize" Value="18"/>
  18. <Setter Property="Focusable" Value="True"/>
  19. <Setter Property="MaxLength" Value="1"/>
  20. <EventSetter Event="PasswordChanged" Handler="PasswordBox_PasswordChanged"/>
  21. <EventSetter Event="PreviewKeyDown" Handler="PasswordBox_KeyDown"/>
  22. </Style>
  23. <Style x:Key="NextTB" TargetType="TextBlock">
  24. <Setter Property="Foreground" Value="#408CCB"/>
  25. <Setter Property="TextDecorations" Value="Underline"/>
  26. <Style.Triggers>
  27. <Trigger Property="IsMouseOver" Value="True">
  28. <Setter Property="Foreground" Value="Red"/>
  29. </Trigger>
  30. </Style.Triggers>
  31. </Style>
  32. </Border.Resources>
  33. <Border.Background>
  34. <SolidColorBrush Color="White" Opacity="0.7"/>
  35. </Border.Background>
  36. <StackPanel VerticalAlignment="Center">
  37. <hc:UniformSpacingPanel Spacing="10" VerticalAlignment="Center" HorizontalAlignment="Center">
  38. <TextBlock x:Name="Title" Text="请输入密码"
  39. FontSize="15"/>
  40. </hc:UniformSpacingPanel>
  41. <Grid Height="65" x:Name="PasswordGrid" Visibility="Visible" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility}">
  42. <TextBlock x:Name="HintMsg"
  43. Visibility="Hidden"
  44. VerticalAlignment="Top"
  45. HorizontalAlignment="Center"
  46. Width="250"
  47. TextAlignment="Center"
  48. Margin="0,3,0,0"
  49. Text="提示:"
  50. hc:Poptip.Content="{Binding ElementName=HintMsg, Path=Text}"
  51. Foreground="Gray"/>
  52. <hc:UniformSpacingPanel Margin="0,20,0,0" Spacing="10" VerticalAlignment="Center" HorizontalAlignment="Center">
  53. <PasswordBox x:Name="P1" Tag="P1" Style="{StaticResource PassBox}"/>
  54. <PasswordBox x:Name="P2" Tag="P2" Style="{StaticResource PassBox}"/>
  55. <PasswordBox x:Name="P3" Tag="P3" Style="{StaticResource PassBox}"/>
  56. <PasswordBox x:Name="P4" Tag="P4" Style="{StaticResource PassBox}"/>
  57. </hc:UniformSpacingPanel>
  58. <TextBlock HorizontalAlignment="Right"
  59. x:Name="ErrorMsg"
  60. Margin="0,65,37,-65"
  61. Foreground="Red"
  62. Text="密码输入错误"
  63. Visibility="Visible"/>
  64. </Grid>
  65. <Grid Height="65" x:Name="HintGrid" Visibility="Collapsed" Margin="0,20,0,0" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeIn}, Event=Visibility}">
  66. <hc:UniformSpacingPanel Spacing="10" VerticalAlignment="Top" HorizontalAlignment="Center">
  67. <hc:TextBox x:Name="HintBox" TextAlignment="Left" Width="220"/>
  68. </hc:UniformSpacingPanel>
  69. <hc:UniformSpacingPanel Spacing="10" Margin="202,35,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">
  70. <TextBlock Text="跳过" MouseLeftButtonDown="NextTB_MouseLeftButtonDown" Style="{StaticResource NextTB}"/>
  71. <TextBlock Text="完成" MouseLeftButtonDown="DoneTB_MouseLeftButtonDown" Style="{StaticResource NextTB}"/>
  72. </hc:UniformSpacingPanel>
  73. </Grid>
  74. </StackPanel>
  75. </Border>