终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

349 lines
16 KiB

  1. <Window
  2. x:Class="BPASmartClient.CustomResource.Pages.View.PasswordChangeView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:common="clr-namespace:BPASmartClient.CustomResource.Pages.Model"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
  10. Title="PasswordChangeView"
  11. Width="500"
  12. Height="350"
  13. AllowsTransparency="True"
  14. Background="{x:Null}"
  15. Topmost="True"
  16. WindowStartupLocation="CenterScreen"
  17. WindowStyle="None"
  18. mc:Ignorable="d">
  19. <Window.DataContext>
  20. <vm:PasswordChangeViewModel />
  21. </Window.DataContext>
  22. <Window.Resources>
  23. <Style x:Key="TxLogin" TargetType="TextBlock">
  24. <Setter Property="FontSize" Value="20" />
  25. <Setter Property="Foreground" Value="#ddd" />
  26. <Setter Property="HorizontalAlignment" Value="Center" />
  27. <Setter Property="VerticalAlignment" Value="Center" />
  28. </Style>
  29. <!--#region 密码输入框样式-->
  30. <Style x:Key="PasswordBoxStyle" TargetType="{x:Type PasswordBox}">
  31. <Setter Property="Background" Value="Transparent" />
  32. <Setter Property="FontFamily" Value="Times New Roman" />
  33. <Setter Property="PasswordChar" Value="●" />
  34. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  35. <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
  36. <Setter Property="HorizontalContentAlignment" Value="Left" />
  37. <Setter Property="Padding" Value="1" />
  38. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  39. <Setter Property="AllowDrop" Value="true" />
  40. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
  41. <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
  42. <Setter Property="CaretBrush" Value="#009DFF" />
  43. <Setter Property="Template">
  44. <Setter.Value>
  45. <ControlTemplate TargetType="{x:Type PasswordBox}">
  46. <Border
  47. x:Name="Bd"
  48. Background="{TemplateBinding Background}"
  49. BorderBrush="{TemplateBinding BorderBrush}"
  50. BorderThickness="{TemplateBinding BorderThickness}"
  51. CornerRadius="5"
  52. SnapsToDevicePixels="true">
  53. <Grid>
  54. <Grid.ColumnDefinitions>
  55. <ColumnDefinition Width="40" />
  56. <ColumnDefinition />
  57. </Grid.ColumnDefinitions>
  58. <TextBlock
  59. x:Name="UserTextBlock"
  60. HorizontalAlignment="Center"
  61. VerticalAlignment="Center"
  62. FontFamily="../../Fonts/#iconfont"
  63. FontSize="20"
  64. Foreground="{TemplateBinding BorderBrush}"
  65. Text="&#xe850;" />
  66. <!--<TextBlock
  67. Name="markText"
  68. Grid.Column="1"
  69. Margin="10,0"
  70. HorizontalAlignment="Left"
  71. VerticalAlignment="Center"
  72. FontSize="20"
  73. Foreground="#88009dff"
  74. Text="请输入账号密码"
  75. Visibility="Collapsed" />-->
  76. <ScrollViewer
  77. x:Name="PART_ContentHost"
  78. Grid.Column="1"
  79. MinHeight="20"
  80. VerticalAlignment="Center"
  81. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  82. </Grid>
  83. </Border>
  84. <ControlTemplate.Triggers>
  85. <Trigger Property="IsEnabled" Value="false">
  86. <Setter TargetName="Bd" Property="Opacity" Value="0.56" />
  87. <Setter TargetName="UserTextBlock" Property="Opacity" Value="0.56" />
  88. </Trigger>
  89. <Trigger Property="IsMouseOver" Value="true">
  90. <Setter TargetName="Bd" Property="BorderBrush" Value="#FF7EB4EA" />
  91. <Setter TargetName="UserTextBlock" Property="Foreground" Value="#FF7EB4EA" />
  92. </Trigger>
  93. <Trigger Property="IsKeyboardFocused" Value="true">
  94. <Setter TargetName="Bd" Property="BorderBrush" Value="#FF569DE5" />
  95. <Setter TargetName="UserTextBlock" Property="Foreground" Value="#FF569DE5" />
  96. </Trigger>
  97. <!--<DataTrigger Binding="{Binding Path=Password, RelativeSource={RelativeSource Mode=self}}" Value="">
  98. <Setter TargetName="markText" Property="Visibility" Value="Visible" />
  99. </DataTrigger>-->
  100. </ControlTemplate.Triggers>
  101. </ControlTemplate>
  102. </Setter.Value>
  103. </Setter>
  104. <Style.Triggers>
  105. <MultiTrigger>
  106. <MultiTrigger.Conditions>
  107. <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true" />
  108. <Condition Property="IsSelectionActive" Value="false" />
  109. </MultiTrigger.Conditions>
  110. <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
  111. </MultiTrigger>
  112. </Style.Triggers>
  113. </Style>
  114. <!--#endregion-->
  115. <!--#region 用户输入框样式-->
  116. <Style x:Key="UserTextBoxStyle" TargetType="TextBox">
  117. <Setter Property="Background" Value="Transparent" />
  118. <Setter Property="CaretBrush" Value="#009DFF" />
  119. <Setter Property="Template">
  120. <Setter.Value>
  121. <ControlTemplate TargetType="TextBox">
  122. <Border
  123. x:Name="border"
  124. Background="{TemplateBinding Background}"
  125. BorderBrush="{TemplateBinding BorderBrush}"
  126. BorderThickness="{TemplateBinding BorderThickness}"
  127. CornerRadius="5"
  128. SnapsToDevicePixels="true">
  129. <Grid>
  130. <Grid.ColumnDefinitions>
  131. <ColumnDefinition Width="40" />
  132. <ColumnDefinition />
  133. </Grid.ColumnDefinitions>
  134. <TextBlock
  135. x:Name="PasswordTextBlock"
  136. HorizontalAlignment="Center"
  137. VerticalAlignment="Center"
  138. FontFamily="../../Fonts/#iconfont"
  139. FontSize="20"
  140. Foreground="{TemplateBinding BorderBrush}"
  141. Text="&#xe66d;" />
  142. <TextBlock
  143. Name="markText"
  144. Grid.Column="1"
  145. Margin="10,0"
  146. HorizontalAlignment="Left"
  147. VerticalAlignment="Center"
  148. FontSize="20"
  149. Foreground="#88009dff"
  150. Text="请输入账号名称"
  151. Visibility="Collapsed" />
  152. <ScrollViewer
  153. x:Name="PART_ContentHost"
  154. Grid.Column="1"
  155. MinHeight="20"
  156. VerticalAlignment="Center"
  157. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  158. </Grid>
  159. </Border>
  160. <ControlTemplate.Triggers>
  161. <Trigger Property="IsEnabled" Value="false">
  162. <Setter TargetName="border" Property="Opacity" Value="0.56" />
  163. </Trigger>
  164. <Trigger Property="IsMouseOver" Value="true">
  165. <Setter TargetName="border" Property="BorderBrush" Value="#FF7EB4EA" />
  166. </Trigger>
  167. <Trigger Property="IsKeyboardFocused" Value="true">
  168. <Setter TargetName="border" Property="BorderBrush" Value="#FF569DE5" />
  169. </Trigger>
  170. <DataTrigger Binding="{Binding Path=Text, RelativeSource={RelativeSource Mode=self}}" Value="">
  171. <Setter TargetName="markText" Property="Visibility" Value="Visible" />
  172. </DataTrigger>
  173. </ControlTemplate.Triggers>
  174. </ControlTemplate>
  175. </Setter.Value>
  176. </Setter>
  177. </Style>
  178. <!--#endregion-->
  179. </Window.Resources>
  180. <Border
  181. x:Name="br"
  182. BorderBrush="#009dff"
  183. BorderThickness="2">
  184. <Border.Effect>
  185. <DropShadowEffect
  186. BlurRadius="10"
  187. ShadowDepth="1"
  188. Color="#009DFF" />
  189. </Border.Effect>
  190. <Grid>
  191. <Image Source="../../Image/登录界面背景.jpg" Stretch="Fill" />
  192. <Image Source="../../Image/阴影边框.png" Stretch="Fill" />
  193. <Grid Margin="50,20">
  194. <Grid.RowDefinitions>
  195. <RowDefinition />
  196. <RowDefinition />
  197. <RowDefinition />
  198. <RowDefinition />
  199. <RowDefinition />
  200. </Grid.RowDefinitions>
  201. <TextBlock
  202. Margin="0,10,0,0"
  203. HorizontalAlignment="Center"
  204. FontSize="20"
  205. Foreground="#ddd"
  206. Text="密码修改" />
  207. <TextBlock
  208. Margin="20,10,0,0"
  209. HorizontalAlignment="Left"
  210. VerticalAlignment="Bottom"
  211. FontSize="16"
  212. Foreground="#FFEF2020"
  213. Text="{Binding ErrorInfo}" />
  214. <Grid Grid.Row="1">
  215. <PasswordBox
  216. Name="oldpb"
  217. Height="40"
  218. Margin="20,0"
  219. common:PasswordHelper.Attach="True"
  220. common:PasswordHelper.Password="{Binding OldPassword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  221. BorderBrush="#009DFF"
  222. FontSize="16"
  223. Foreground="#aadddddd"
  224. PasswordChanged="oldpb_PasswordChanged"
  225. Style="{DynamicResource PasswordBoxStyle}"
  226. TabIndex="2" />
  227. <TextBlock
  228. Name="oldmarkText"
  229. Margin="70,0"
  230. HorizontalAlignment="Left"
  231. VerticalAlignment="Center"
  232. FontSize="20"
  233. Foreground="#88009dff"
  234. IsHitTestVisible="False"
  235. Text="请输入原密码"
  236. Visibility="Visible" />
  237. </Grid>
  238. <Grid Grid.Row="2">
  239. <PasswordBox
  240. Name="newpb1"
  241. Height="40"
  242. Margin="20,0"
  243. common:PasswordHelper.Attach="True"
  244. common:PasswordHelper.Password="{Binding NewPassword1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  245. BorderBrush="#009DFF"
  246. FontSize="16"
  247. Foreground="#aadddddd"
  248. PasswordChanged="newpb1_PasswordChanged"
  249. Style="{DynamicResource PasswordBoxStyle}"
  250. TabIndex="2" />
  251. <TextBlock
  252. Name="newmarkText1"
  253. Margin="70,0"
  254. HorizontalAlignment="Left"
  255. VerticalAlignment="Center"
  256. FontSize="20"
  257. Foreground="#88009dff"
  258. IsHitTestVisible="False"
  259. Text="请输入新密码"
  260. Visibility="Visible" />
  261. </Grid>
  262. <Grid Grid.Row="3">
  263. <PasswordBox
  264. Name="newpb2"
  265. Height="40"
  266. Margin="20,0"
  267. common:PasswordHelper.Attach="True"
  268. common:PasswordHelper.Password="{Binding NewPassword2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  269. BorderBrush="#009DFF"
  270. FontSize="16"
  271. Foreground="#aadddddd"
  272. PasswordChanged="newpb2_PasswordChanged"
  273. Style="{DynamicResource PasswordBoxStyle}"
  274. TabIndex="2" />
  275. <TextBlock
  276. Name="newmarkText2"
  277. Margin="70,0"
  278. HorizontalAlignment="Left"
  279. VerticalAlignment="Center"
  280. FontSize="20"
  281. Foreground="#88009dff"
  282. IsHitTestVisible="False"
  283. Text="请再次输入新密码"
  284. Visibility="Visible" />
  285. </Grid>
  286. <Grid Grid.Row="4">
  287. <Grid.ColumnDefinitions>
  288. <ColumnDefinition />
  289. <ColumnDefinition />
  290. </Grid.ColumnDefinitions>
  291. <Button
  292. Margin="20,10"
  293. Background="#009DFF"
  294. BorderThickness="0"
  295. Command="{Binding ExitCommand}"
  296. Content="取 消"
  297. FontSize="20"
  298. Foreground="White" />
  299. <Button
  300. Grid.Column="1"
  301. Margin="20,10"
  302. Background="#009DFF"
  303. BorderThickness="0"
  304. Command="{Binding LoginCommand}"
  305. Content="确 认"
  306. FontSize="20"
  307. Foreground="White"
  308. TabIndex="3" />
  309. </Grid>
  310. </Grid>
  311. </Grid>
  312. </Border>
  313. </Window>