终端一体化运控平台
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.
 
 
 

331 line
15 KiB

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