终端一体化运控平台
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

328 lignes
15 KiB

  1. <Window
  2. x:Class="BPASmartClient.CustomResource.Pages.View.SubPagLoginView"
  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="SubPagLoginView"
  11. Width="800"
  12. Height="450"
  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:LoginViewModel />
  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="{TemplateBinding FontSize}"
  64. Foreground="{TemplateBinding BorderBrush}"
  65. Text="&#xe60c;" />
  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="{TemplateBinding FontSize}"
  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="{TemplateBinding FontSize}"
  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="{TemplateBinding FontSize}"
  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. <!--#region 操作按钮样式-->
  180. <Style x:Key="ButtonStyle" TargetType="Button">
  181. <Setter Property="Margin" Value="5" />
  182. <Setter Property="Background" Value="#cc009DFF" />
  183. <Setter Property="BorderThickness" Value="0" />
  184. <Setter Property="FontSize" Value="16" />
  185. <Setter Property="Foreground" Value="White" />
  186. <Setter Property="Template">
  187. <Setter.Value>
  188. <ControlTemplate TargetType="Button">
  189. <Border
  190. Name="TitleBarBr"
  191. Background="{TemplateBinding Background}"
  192. BorderBrush="{TemplateBinding BorderBrush}"
  193. BorderThickness="{TemplateBinding BorderThickness}"
  194. CornerRadius="5">
  195. <ContentPresenter
  196. Margin="{TemplateBinding Margin}"
  197. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  198. VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  199. </Border>
  200. <ControlTemplate.Triggers>
  201. <Trigger Property="IsMouseOver" Value="true">
  202. <Setter TargetName="TitleBarBr" Property="Background" Value="#009DFF" />
  203. </Trigger>
  204. </ControlTemplate.Triggers>
  205. </ControlTemplate>
  206. </Setter.Value>
  207. </Setter>
  208. </Style>
  209. <!--#endregion-->
  210. </Window.Resources>
  211. <Grid>
  212. <Grid.Background>
  213. <ImageBrush ImageSource="../../Image/智慧城市科技风登录页面边框.png" />
  214. </Grid.Background>
  215. <Grid.ColumnDefinitions>
  216. <ColumnDefinition Width="1.05*" />
  217. <ColumnDefinition />
  218. <ColumnDefinition />
  219. </Grid.ColumnDefinitions>
  220. <Grid.RowDefinitions>
  221. <RowDefinition Height="0.9*" />
  222. <RowDefinition />
  223. <RowDefinition Height="1.2*" />
  224. </Grid.RowDefinitions>
  225. <TextBlock
  226. Grid.Column="1"
  227. HorizontalAlignment="Center"
  228. VerticalAlignment="Center"
  229. FontSize="16"
  230. Foreground="#FFEF2020"
  231. Text="{Binding ErrorInfo}" />
  232. <Grid
  233. x:Name="grid"
  234. Grid.Row="1"
  235. Grid.Column="1">
  236. <Grid.RowDefinitions>
  237. <RowDefinition />
  238. <RowDefinition />
  239. <RowDefinition />
  240. </Grid.RowDefinitions>
  241. <TextBox
  242. Name="Username"
  243. Margin="5,5"
  244. BorderBrush="#009DFF"
  245. BorderThickness="3"
  246. FontSize="16"
  247. Foreground="#009DFF"
  248. KeyDown="TextBox_KeyDown"
  249. Style="{DynamicResource UserTextBoxStyle}"
  250. TabIndex="1"
  251. Text="{Binding UserName}" />
  252. <PasswordBox
  253. Name="pb"
  254. Grid.Row="1"
  255. Margin="5"
  256. common:PasswordHelper.Attach="True"
  257. common:PasswordHelper.Password="{Binding Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  258. BorderBrush="#009DFF"
  259. BorderThickness="3"
  260. FontSize="16"
  261. Foreground="#009DFF"
  262. KeyDown="pb_KeyDown"
  263. PasswordChanged="PasswordBox_PasswordChanged"
  264. Style="{DynamicResource PasswordBoxStyle}"
  265. TabIndex="2" />
  266. <TextBlock
  267. Name="markText"
  268. Grid.Row="1"
  269. Margin="58,5"
  270. HorizontalAlignment="Left"
  271. VerticalAlignment="Center"
  272. FontSize="16"
  273. Foreground="#88009dff"
  274. IsHitTestVisible="False"
  275. Text="请输入账号密码"
  276. Visibility="Visible" />
  277. <Grid Grid.Row="2">
  278. <Grid.ColumnDefinitions>
  279. <ColumnDefinition />
  280. <ColumnDefinition />
  281. </Grid.ColumnDefinitions>
  282. <Button
  283. Command="{Binding ExitCommand}"
  284. Content="退 出"
  285. Style="{StaticResource ButtonStyle}" />
  286. <Button
  287. Grid.Column="1"
  288. Command="{Binding LoginCommand}"
  289. Content="登 录"
  290. Style="{StaticResource ButtonStyle}"
  291. TabIndex="3" />
  292. </Grid>
  293. </Grid>
  294. </Grid>
  295. </Window>