PasswordPromptWindow.xaml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <Window x:Class="NetTool.Client.PasswordPromptWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. Title="输入管理密码"
  5. Width="420"
  6. SizeToContent="Height"
  7. ResizeMode="NoResize"
  8. WindowStartupLocation="CenterOwner">
  9. <Grid Margin="20,20,20,24">
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="Auto" />
  12. <RowDefinition Height="Auto" />
  13. <RowDefinition Height="Auto" />
  14. </Grid.RowDefinitions>
  15. <TextBlock x:Name="PromptTextBlock"
  16. Foreground="#111827"
  17. TextWrapping="Wrap" />
  18. <Grid Grid.Row="1"
  19. Margin="0,16,0,0">
  20. <PasswordBox x:Name="PasswordBox"
  21. MinHeight="36"
  22. Padding="0,0,36,0"
  23. VerticalContentAlignment="Center" />
  24. <TextBox x:Name="PasswordTextBox"
  25. MinHeight="36"
  26. Padding="0,0,36,0"
  27. VerticalContentAlignment="Center"
  28. TextChanged="PasswordTextBox_OnTextChanged"
  29. Visibility="Collapsed" />
  30. <Button x:Name="TogglePasswordVisibilityButton"
  31. Width="30"
  32. Height="30"
  33. Margin="0,3,3,3"
  34. Padding="0"
  35. HorizontalAlignment="Right"
  36. VerticalAlignment="Center"
  37. Background="Transparent"
  38. BorderThickness="0"
  39. Click="TogglePasswordVisibilityButton_OnClick"
  40. Cursor="Hand"
  41. Foreground="#6B7280"
  42. ToolTip="查看密码">
  43. <Grid Width="16"
  44. Height="16">
  45. <Viewbox x:Name="ShowPasswordIcon"
  46. Stretch="Uniform">
  47. <Canvas Width="1024"
  48. Height="1024">
  49. <Path Data="M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"
  50. Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=Button}}" />
  51. <Path Data="M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"
  52. Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=Button}}" />
  53. </Canvas>
  54. </Viewbox>
  55. <Viewbox x:Name="HidePasswordIcon"
  56. Stretch="Uniform"
  57. Visibility="Collapsed">
  58. <Canvas Width="1024"
  59. Height="1024">
  60. <Path Data="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"
  61. Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=Button}}" />
  62. </Canvas>
  63. </Viewbox>
  64. </Grid>
  65. </Button>
  66. </Grid>
  67. <Button x:Name="ClearPasswordButton"
  68. Grid.Row="2"
  69. Margin="0,20,0,0"
  70. Padding="0"
  71. HorizontalAlignment="Left"
  72. VerticalAlignment="Center"
  73. Background="Transparent"
  74. BorderThickness="0"
  75. Click="ClearPasswordButton_OnClick"
  76. Content="清除已保存密码"
  77. Cursor="Hand"
  78. FontSize="12"
  79. Foreground="#6B7280" />
  80. <StackPanel Grid.Row="2"
  81. Margin="0,20,0,0"
  82. HorizontalAlignment="Right"
  83. Orientation="Horizontal">
  84. <Button MinWidth="78"
  85. Height="36"
  86. Click="CancelButton_OnClick"
  87. Content="取消" />
  88. <Button MinWidth="78"
  89. Height="36"
  90. Margin="10,0,0,0"
  91. Style="{StaticResource PrimaryButtonStyle}"
  92. Click="OkButton_OnClick"
  93. Content="连接" />
  94. </StackPanel>
  95. </Grid>
  96. </Window>