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.

311 regels
13 KiB

  1. <hc:Window
  2. x:Class="HKCardIN.Views.RootView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:hc="https://handyorg.github.io/handycontrol"
  7. xmlns:local="clr-namespace:HKCardIN"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:s="https://github.com/canton7/Stylet"
  10. xmlns:viewModels="clr-namespace:HKCardIN.ViewModels"
  11. x:Name="Root"
  12. Title="海科智慧一卡通平台"
  13. Width="800"
  14. Height="420"
  15. d:DataContext="{d:DesignInstance Type=viewModels:RootViewModel}"
  16. ShowMaxButton="False"
  17. ShowTitle="True"
  18. WindowStartupLocation="CenterScreen"
  19. mc:Ignorable="d">
  20. <hc:Window.Resources>
  21. <Style
  22. x:Key="充值"
  23. BasedOn="{StaticResource ButtonDefault}"
  24. TargetType="Button">
  25. <Setter Property="Width" Value="75" />
  26. <Setter Property="Height" Value="75" />
  27. <Setter Property="Margin" Value="5" />
  28. <Setter Property="Foreground" Value="Red" />
  29. <Setter Property="FontSize" Value="18" />
  30. </Style>
  31. <Style
  32. x:Key="操作"
  33. BasedOn="{StaticResource ButtonDefault}"
  34. TargetType="Button">
  35. <Setter Property="Width" Value="120" />
  36. <Setter Property="Height" Value="75" />
  37. <Setter Property="Margin" Value="5" />
  38. <Setter Property="Foreground" Value="Red" />
  39. <Setter Property="FontSize" Value="18" />
  40. </Style>
  41. <Style
  42. x:Key="Title"
  43. BasedOn="{StaticResource TextBlockDefaultBold}"
  44. TargetType="TextBlock">
  45. <Setter Property="Foreground" Value="WhiteSmoke" />
  46. </Style>
  47. </hc:Window.Resources>
  48. <hc:Window.Background>
  49. <ImageBrush ImageSource="/HKResouces/背景.jpg" />
  50. </hc:Window.Background>
  51. <hc:Window.InputBindings>
  52. <KeyBinding
  53. Key="F1"
  54. Command="{s:Action InputAction}"
  55. CommandParameter="50" />
  56. <KeyBinding
  57. Key="F2"
  58. Command="{s:Action InputAction}"
  59. CommandParameter="100" />
  60. <KeyBinding
  61. Key="F3"
  62. Command="{s:Action InputAction}"
  63. CommandParameter="200" />
  64. <KeyBinding
  65. Key="F4"
  66. Command="{s:Action InputAction}"
  67. CommandParameter="500" />
  68. <KeyBinding Key="F5" Command="{s:Action LockSreenAction}" />
  69. </hc:Window.InputBindings>
  70. <Grid>
  71. <StackPanel
  72. HorizontalAlignment="Center"
  73. VerticalAlignment="Center"
  74. Visibility="{Binding CodeVisible}">
  75. <TextBox
  76. Width="200"
  77. hc:InfoElement.Placeholder="请输入解锁码"
  78. Style="{StaticResource TextBoxExtend}"
  79. Text="{Binding LockCode}" />
  80. <WrapPanel Margin="0,10,0,0" HorizontalAlignment="Center">
  81. <Button
  82. Width="60"
  83. Height="40"
  84. Margin="0,0,10,0"
  85. Command="{s:Action UnLockAction}"
  86. Content="确定"
  87. FontSize="15" />
  88. <Button
  89. Width="60"
  90. Height="40"
  91. Margin="10,0,0,0"
  92. Command="{s:Action ResetAction}"
  93. Content="取消"
  94. FontSize="15" />
  95. </WrapPanel>
  96. </StackPanel>
  97. <Grid Visibility="{Binding ContentVisible}">
  98. <Grid.ColumnDefinitions>
  99. <ColumnDefinition />
  100. <ColumnDefinition Width="13" />
  101. <ColumnDefinition />
  102. </Grid.ColumnDefinitions>
  103. <StackPanel Margin="0,12,0,0">
  104. <Grid>
  105. <Grid.ColumnDefinitions>
  106. <ColumnDefinition Width=".4*" />
  107. <ColumnDefinition Width=".6*" />
  108. </Grid.ColumnDefinitions>
  109. <Border
  110. Width="100"
  111. Height="120"
  112. BorderBrush="BlanchedAlmond"
  113. BorderThickness="1">
  114. <Border.Effect>
  115. <DropShadowEffect ShadowDepth="1" Color="Black" />
  116. </Border.Effect>
  117. <Image
  118. Width="100"
  119. Height="120"
  120. Source="/HKResouces/头像.png"
  121. Stretch="UniformToFill" />
  122. </Border>
  123. <StackPanel Grid.Column="1">
  124. <WrapPanel>
  125. <TextBlock
  126. FontSize="18"
  127. Style="{StaticResource Title}"
  128. Text="姓名:" />
  129. <TextBlock
  130. FontSize="18"
  131. Foreground="Red"
  132. Style="{StaticResource TextBlockDefaultBold}"
  133. Text="李四" />
  134. </WrapPanel>
  135. <WrapPanel Margin="0,20,0,0">
  136. <TextBlock
  137. FontSize="18"
  138. Style="{StaticResource Title}"
  139. Text="手机:" />
  140. <TextBlock
  141. FontSize="18"
  142. Foreground="Red"
  143. Style="{StaticResource TextBlockDefaultBold}"
  144. Text="13812345678" />
  145. </WrapPanel>
  146. <WrapPanel Margin="0,20,0,0">
  147. <TextBlock
  148. FontSize="18"
  149. Style="{StaticResource Title}"
  150. Text="员工号:" />
  151. <TextBlock
  152. FontSize="18"
  153. Foreground="Red"
  154. Style="{StaticResource TextBlockDefaultBold}"
  155. Text="001" />
  156. </WrapPanel>
  157. </StackPanel>
  158. </Grid>
  159. <hc:Divider
  160. Content="卡信息"
  161. FontSize="16"
  162. FontWeight="Bold"
  163. Foreground="WhiteSmoke" />
  164. <StackPanel Margin="20,0,0,0">
  165. <WrapPanel>
  166. <TextBlock
  167. FontSize="18"
  168. Style="{StaticResource Title}"
  169. Text="卡号:" />
  170. <TextBlock
  171. FontSize="18"
  172. Foreground="Red"
  173. Style="{StaticResource TextBlockDefaultBold}"
  174. Text="123456" />
  175. </WrapPanel>
  176. <WrapPanel Margin="0,20,0,0">
  177. <TextBlock
  178. FontSize="18"
  179. Style="{StaticResource Title}"
  180. Text="卡状态:" />
  181. <TextBlock
  182. FontSize="18"
  183. Foreground="Red"
  184. Style="{StaticResource TextBlockDefaultBold}"
  185. Text="正常" />
  186. </WrapPanel>
  187. <WrapPanel Margin="0,20,0,0">
  188. <TextBlock
  189. FontSize="18"
  190. Style="{StaticResource Title}"
  191. Text="卡上余额:" />
  192. <TextBlock
  193. FontSize="18"
  194. Foreground="Red"
  195. Style="{StaticResource TextBlockDefaultBold}"
  196. Text="123456" />
  197. </WrapPanel>
  198. <WrapPanel Margin="0,20,0,0">
  199. <TextBlock
  200. FontSize="18"
  201. Style="{StaticResource Title}"
  202. Text="启用日期:" />
  203. <TextBlock
  204. FontSize="18"
  205. Foreground="Red"
  206. Style="{StaticResource TextBlockDefaultBold}"
  207. Text="2021-01-01" />
  208. </WrapPanel>
  209. </StackPanel>
  210. </StackPanel>
  211. <hc:Divider
  212. Grid.Column="1"
  213. Height="{Binding ActualHeight, ElementName=Root}"
  214. Orientation="Vertical" />
  215. <StackPanel Grid.Column="2">
  216. <hc:Divider
  217. Content="充值金额"
  218. FontSize="16"
  219. FontWeight="Bold"
  220. Foreground="WhiteSmoke" />
  221. <TextBlock
  222. Margin="5,0,0,0"
  223. FontSize="18"
  224. Style="{StaticResource Title}">
  225. <Run Foreground="WhiteSmoke" Text="当前充值金额:" />
  226. <Run Foreground="Red" Text="{Binding ShowMoney}" />
  227. </TextBlock>
  228. <WrapPanel HorizontalAlignment="Center">
  229. <Button
  230. Command="{s:Action InputAction}"
  231. CommandParameter="50"
  232. Style="{StaticResource 充值}">
  233. <Button.Content>
  234. <StackPanel HorizontalAlignment="Center">
  235. <TextBlock HorizontalAlignment="Center" Text="¥50" />
  236. <TextBlock HorizontalAlignment="Center" Text="[F1]" />
  237. </StackPanel>
  238. </Button.Content>
  239. </Button>
  240. <Button
  241. Command="{s:Action InputAction}"
  242. CommandParameter="100"
  243. Style="{StaticResource 充值}">
  244. <Button.Content>
  245. <StackPanel HorizontalAlignment="Center">
  246. <TextBlock HorizontalAlignment="Center" Text="¥100" />
  247. <TextBlock HorizontalAlignment="Center" Text="[F2]" />
  248. </StackPanel>
  249. </Button.Content>
  250. </Button>
  251. <Button
  252. Command="{s:Action InputAction}"
  253. CommandParameter="200"
  254. Style="{StaticResource 充值}">
  255. <Button.Content>
  256. <StackPanel HorizontalAlignment="Center">
  257. <TextBlock HorizontalAlignment="Center" Text="¥200" />
  258. <TextBlock HorizontalAlignment="Center" Text="[F3]" />
  259. </StackPanel>
  260. </Button.Content>
  261. </Button>
  262. <Button
  263. Command="{s:Action InputAction}"
  264. CommandParameter="500"
  265. Style="{StaticResource 充值}">
  266. <Button.Content>
  267. <StackPanel HorizontalAlignment="Center">
  268. <TextBlock HorizontalAlignment="Center" Text="¥500" />
  269. <TextBlock HorizontalAlignment="Center" Text="[F4]" />
  270. </StackPanel>
  271. </Button.Content>
  272. </Button>
  273. </WrapPanel>
  274. <WrapPanel HorizontalAlignment="Center">
  275. <TextBox
  276. Width="330"
  277. Margin="5,10,0,10"
  278. HorizontalAlignment="Left"
  279. hc:InfoElement.Placeholder="请输入自定义金额"
  280. Style="{StaticResource TextBoxExtend}">
  281. <TextBox.Text>
  282. <Binding Path="InputMoney" UpdateSourceTrigger="PropertyChanged">
  283. <Binding.ValidationRules>
  284. <local:ValidataRule />
  285. </Binding.ValidationRules>
  286. </Binding>
  287. </TextBox.Text>
  288. </TextBox>
  289. </WrapPanel>
  290. <hc:Divider
  291. Content="操作"
  292. FontSize="16"
  293. FontWeight="Bold"
  294. Foreground="WhiteSmoke" />
  295. <WrapPanel HorizontalAlignment="Center">
  296. <Button
  297. Command="{s:Action SaveAction}"
  298. Content="确定[Enter]"
  299. IsDefault="True"
  300. Style="{StaticResource 操作}" />
  301. <Button
  302. Command="{s:Action LockSreenAction}"
  303. Content="锁屏[F5]"
  304. IsDefault="True"
  305. Style="{StaticResource 操作}" />
  306. </WrapPanel>
  307. </StackPanel>
  308. </Grid>
  309. </Grid>
  310. </hc:Window>