MainWindow.xaml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <Window
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore"
  6. xmlns:local="clr-namespace:AwInitilizer"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:resx="clr-namespace:AwInitilizer.Resx"
  9. x:Name="uxManinWindow"
  10. Title="Initializer"
  11. Width="1920"
  12. Height="1080"
  13. d:DataContext="{d:DesignInstance Type=local:MainViewModel}"
  14. input:InputMethod.IsInputMethodEnabled="False"
  15. Background="#FF363535"
  16. PreviewKeyDown="MainWindow_PreviewKeyDown"
  17. WindowStartupLocation="CenterScreen"
  18. WindowState="Maximized"
  19. mc:Ignorable="d"
  20. x:Class="AwInitilizer.MainWindow">
  21. <Window.Resources />
  22. <Viewbox>
  23. <StackPanel Orientation="Vertical">
  24. <StackPanel Orientation="Horizontal">
  25. <StackPanel
  26. Width="400"
  27. Margin="10,0,0,0"
  28. Orientation="Vertical">
  29. <GroupBox>
  30. <GroupBox.Header>
  31. <Label
  32. FontSize="16"
  33. Content="{x:Static resx:AppResources.Account}"
  34. Foreground="White" />
  35. </GroupBox.Header>
  36. <StackPanel Orientation="Vertical">
  37. <Button
  38. Width="100"
  39. Click="Logout_Click"
  40. IsEnabled="{Binding IsInputLock}">
  41. <Label Content="{x:Static resx:AppResources.Logout}" />
  42. </Button>
  43. <StackPanel
  44. Height="30"
  45. Margin="0,10,0,10"
  46. Orientation="Horizontal">
  47. <Grid Width="178">
  48. <Label
  49. HorizontalAlignment="Center"
  50. FontSize="16"
  51. Content="{x:Static resx:AppResources.UserID}"
  52. Foreground="White" />
  53. </Grid>
  54. <TextBox
  55. Width="200"
  56. VerticalContentAlignment="Center"
  57. Text="{Binding UserID}"
  58. FontSize="16"
  59. IsEnabled="{Binding IsInputLock}"
  60. IsReadOnly="True"
  61. TextAlignment="Center" />
  62. </StackPanel>
  63. <StackPanel
  64. Height="30"
  65. Margin="0,0,0,10"
  66. Orientation="Horizontal">
  67. <Grid Width="178">
  68. <Label
  69. HorizontalAlignment="Center"
  70. FontSize="16"
  71. Content="{x:Static resx:AppResources.WorkOrder}"
  72. Foreground="White" />
  73. </Grid>
  74. <TextBox
  75. Width="200"
  76. VerticalContentAlignment="Center"
  77. Text="{Binding WorkOrder}"
  78. FontSize="16"
  79. IsEnabled="{Binding IsInputLock}"
  80. IsReadOnly="True"
  81. KeyDown="WorkOrder_KeyDown"
  82. TextAlignment="Center"
  83. TextChanged="WorkOrder_TextChanged" />
  84. </StackPanel>
  85. </StackPanel>
  86. </GroupBox>
  87. <GroupBox>
  88. <GroupBox.Header>
  89. <Label
  90. FontSize="16"
  91. Content="{x:Static resx:AppResources.BarcodeSetting}"
  92. Foreground="White" />
  93. </GroupBox.Header>
  94. <StackPanel Orientation="Vertical">
  95. <StackPanel Height="30" Orientation="Horizontal">
  96. <Grid Width="178">
  97. <Label
  98. HorizontalAlignment="Center"
  99. FontSize="16"
  100. Content="{x:Static resx:AppResources.ModelName}"
  101. Foreground="White" />
  102. </Grid>
  103. <TextBox
  104. x:Name="uxModelName"
  105. Width="200"
  106. VerticalContentAlignment="Center"
  107. Text="{Binding ModelName}"
  108. FontSize="16"
  109. IsEnabled="{Binding IsInputLock}"
  110. IsReadOnly="True"
  111. TextAlignment="Center" />
  112. </StackPanel>
  113. <StackPanel
  114. Height="30"
  115. Margin="0,10,0,10"
  116. Orientation="Horizontal">
  117. <Grid Width="178">
  118. <Label
  119. HorizontalAlignment="Center"
  120. FontSize="16"
  121. Content="{x:Static resx:AppResources.SerialNumber}"
  122. Foreground="White" />
  123. </Grid>
  124. <TextBox
  125. x:Name="uxSerialNumber"
  126. Width="200"
  127. VerticalContentAlignment="Center"
  128. Text="{Binding SerialNumber}"
  129. FontSize="16"
  130. IsEnabled="{Binding IsInputLock}"
  131. IsReadOnly="True"
  132. TextAlignment="Center" />
  133. </StackPanel>
  134. <StackPanel
  135. Height="30"
  136. Margin="0,0,0,10"
  137. Orientation="Horizontal">
  138. <Grid Width="178">
  139. <Label
  140. HorizontalAlignment="Center"
  141. FontSize="16"
  142. Content="{x:Static resx:AppResources.SimStatus}"
  143. Foreground="White" />
  144. </Grid>
  145. <CheckBox
  146. x:Name="uxIsSimCheckEnabled"
  147. VerticalAlignment="Center"
  148. IsChecked="{Binding IsSimInsert}"
  149. IsEnabled="{Binding IsInputLock}"
  150. IsHitTestVisible="False" />
  151. <CheckBox
  152. x:Name="uxIsSimCheckEnabled2"
  153. VerticalAlignment="Center"
  154. IsChecked="{Binding IsSubSimInsert}"
  155. IsEnabled="{Binding IsInputLock}"
  156. IsHitTestVisible="False" />
  157. </StackPanel>
  158. <StackPanel
  159. Height="30"
  160. Margin="0,0,0,10"
  161. Orientation="Horizontal">
  162. <Grid Width="178">
  163. <Label
  164. HorizontalAlignment="Center"
  165. FontSize="16"
  166. Content="{x:Static resx:AppResources.ICCID}"
  167. Foreground="White" />
  168. </Grid>
  169. <TextBox
  170. x:Name="uxICCID"
  171. Width="200"
  172. VerticalContentAlignment="Center"
  173. Text="{Binding UiSimICCID, Mode=OneWay}"
  174. FontSize="16"
  175. IsReadOnly="True"
  176. TextAlignment="Center">
  177. <TextBox.IsEnabled>
  178. <MultiBinding Converter="{StaticResource booleanAndConverter}">
  179. <Binding Path="IsSimInsert" />
  180. <Binding Path="IsInputLock" />
  181. </MultiBinding>
  182. </TextBox.IsEnabled>
  183. </TextBox>
  184. </StackPanel>
  185. <StackPanel
  186. Height="30"
  187. Margin="0,0,0,10"
  188. Orientation="Horizontal">
  189. <Grid Width="178">
  190. <Label
  191. HorizontalAlignment="Center"
  192. FontSize="16"
  193. Content="{x:Static resx:AppResources.IMSI}"
  194. Foreground="White" />
  195. </Grid>
  196. <TextBox
  197. x:Name="uxIMSI"
  198. Width="200"
  199. VerticalContentAlignment="Center"
  200. Text="{Binding UiSimIMSI, Mode=OneWay}"
  201. FontSize="16"
  202. IsReadOnly="True"
  203. TextAlignment="Center">
  204. <TextBox.IsEnabled>
  205. <MultiBinding Converter="{StaticResource booleanAndConverter}">
  206. <Binding Path="IsSimInsert" />
  207. <Binding Path="IsInputLock" />
  208. </MultiBinding>
  209. </TextBox.IsEnabled>
  210. </TextBox>
  211. </StackPanel>
  212. <StackPanel
  213. Height="30"
  214. Margin="0,0,0,10"
  215. Orientation="Horizontal">
  216. <Grid Width="178">
  217. <Label
  218. HorizontalAlignment="Center"
  219. FontSize="16"
  220. Content="{x:Static resx:AppResources.DisableAuth}"
  221. Foreground="White" />
  222. </Grid>
  223. <CheckBox
  224. VerticalAlignment="Center"
  225. IsChecked="{Binding IsDisableAuthRequired}"
  226. IsEnabled="{Binding IsInputLock}"
  227. IsHitTestVisible="False" />
  228. </StackPanel>
  229. </StackPanel>
  230. </GroupBox>
  231. </StackPanel>
  232. <StackPanel
  233. Width="400"
  234. Margin="10,0,0,0"
  235. Orientation="Vertical">
  236. <GroupBox>
  237. <GroupBox.Header>
  238. <Label
  239. FontSize="16"
  240. Content="{x:Static resx:AppResources.FirmwareVersion}"
  241. Foreground="White" />
  242. </GroupBox.Header>
  243. <DataGrid
  244. Height="335"
  245. Margin="10"
  246. AutoGenerateColumns="False"
  247. CanUserSortColumns="False"
  248. IsEnabled="{Binding IsInputLock}"
  249. ItemsSource="{Binding FirmwareUpdateModels}">
  250. <DataGrid.Columns>
  251. <DataGridTextColumn
  252. Width="150"
  253. MinWidth="50"
  254. Binding="{Binding Path=Module}"
  255. Header="{x:Static resx:AppResources.FirmwareVersionHeaderName}"
  256. IsReadOnly="True" />
  257. <DataGridTextColumn
  258. Width="150"
  259. MinWidth="70"
  260. Binding="{Binding Path=Version}"
  261. Header="{x:Static resx:AppResources.FirmwareVersionHeaderVersion}"
  262. IsReadOnly="True" />
  263. <!-- " DataGridTextColumn Header="File name" Binding="{Binding Path=FirmwareFileName}" IsReadOnly="False"/ -->
  264. </DataGrid.Columns>
  265. </DataGrid>
  266. </GroupBox>
  267. </StackPanel>
  268. <Grid Margin="10,0,0,0">
  269. <Grid.RowDefinitions>
  270. <RowDefinition Height="*" />
  271. <RowDefinition Height="30" />
  272. <RowDefinition Height="*" />
  273. </Grid.RowDefinitions>
  274. <Button
  275. x:Name="uxStartBtn"
  276. Grid.Row="0"
  277. Margin="30"
  278. Click="StartInit_Click">
  279. <Button.Template>
  280. <ControlTemplate TargetType="Button">
  281. <Border
  282. Background="White"
  283. BorderBrush="Gray"
  284. BorderThickness="2"
  285. CornerRadius="10">
  286. <Border.Effect>
  287. <DropShadowEffect ShadowDepth="10" />
  288. </Border.Effect>
  289. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
  290. </Border>
  291. </ControlTemplate>
  292. </Button.Template>
  293. <Button.IsEnabled>
  294. <MultiBinding Converter="{StaticResource booleanAndConverter}">
  295. <Binding Path="IsInputLock" />
  296. <Binding Path="IsInputCheckpassed" />
  297. </MultiBinding>
  298. </Button.IsEnabled>
  299. <Label FontSize="36" Content="{x:Static resx:AppResources.StartProcedure}" />
  300. </Button>
  301. <StackPanel Grid.Row="1" Orientation="Vertical">
  302. <StackPanel
  303. HorizontalAlignment="Center"
  304. VerticalAlignment="Center"
  305. Orientation="Horizontal">
  306. <ProgressBar
  307. x:Name="uxProgress"
  308. Width="250"
  309. Height="20"
  310. VerticalAlignment="Center"
  311. Maximum="100"
  312. Minimum="0" />
  313. <Label
  314. x:Name="uxProgressRate"
  315. FontSize="16"
  316. Content="0%"
  317. Foreground="White" />
  318. </StackPanel>
  319. </StackPanel>
  320. <Grid
  321. x:Name="uxStatusContainer"
  322. Grid.Row="2"
  323. Margin="30"
  324. Background="White">
  325. <Label
  326. x:Name="uxStatus"
  327. HorizontalAlignment="Center"
  328. VerticalAlignment="Center"
  329. FontSize="36"
  330. Content="Idle"
  331. Foreground="Black" />
  332. </Grid>
  333. </Grid>
  334. </StackPanel>
  335. <Label
  336. x:Name="uxStatusBar"
  337. Margin="0,10,0,0"
  338. HorizontalAlignment="Center"
  339. FontSize="36"
  340. Content=""
  341. Foreground="White" />
  342. </StackPanel>
  343. </Viewbox>
  344. </Window>