HomeView.xaml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. <UserControl
  2. x:Class="TeamAAS_VP.Views.HomeView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  8. xmlns:local="clr-namespace:TeamAAS_VP.Views.Home"
  9. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  10. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  11. xmlns:oxy="http://oxyplot.org/wpf"
  12. xmlns:prism="http://prismlibrary.com/"
  13. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels"
  14. d:Background="White"
  15. d:DataContext="{d:DesignInstance Type=vm:HomeViewModel}"
  16. d:Height="1080"
  17. d:Width="1920"
  18. lex:LocalizeDictionary.DesignCulture="zh-CN"
  19. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  20. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  21. prism:ViewModelLocator.AutoWireViewModel="True"
  22. Background="Transparent"
  23. FontFamily="{DynamicResource DefaultFont}"
  24. mc:Ignorable="d">
  25. <b:Interaction.Triggers>
  26. <b:EventTrigger EventName="Loaded">
  27. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  28. </b:EventTrigger>
  29. </b:Interaction.Triggers>
  30. <Grid>
  31. <Grid.ColumnDefinitions>
  32. <ColumnDefinition Width="60*" />
  33. <ColumnDefinition Width="40*" />
  34. </Grid.ColumnDefinitions>
  35. <Grid Grid.Row="0">
  36. <Grid.RowDefinitions>
  37. <RowDefinition Height="0.65*" />
  38. <!--<RowDefinition Height="0.4*" />-->
  39. </Grid.RowDefinitions>
  40. <!-- 图像 -->
  41. <local:ShowVisionRender Grid.Row="0" Grid.Column="0" />
  42. <!--<Grid Grid.Row="1">
  43. <Grid.ColumnDefinitions>
  44. <ColumnDefinition Width="*" />
  45. </Grid.ColumnDefinitions>
  46. -->
  47. <!-- 曲线图 -->
  48. <!--
  49. <oxy:PlotView Grid.Row="0"
  50. Grid.Column="0"
  51. Model="{Binding LockCurvePlotModel}"
  52. Background="Transparent"
  53. Margin="10,10,0,10" Grid.ColumnSpan="2" />
  54. -->
  55. <!-- 动态压力曲线集合 -->
  56. <!--
  57. <oxy:PlotView Grid.Row="0"
  58. Grid.Column="1"
  59. Model="{Binding PressurePlotModel}"
  60. Background="Transparent"
  61. Visibility="Hidden"
  62. Margin="0" />
  63. </Grid>-->
  64. </Grid>
  65. <Grid Grid.Row="1" Grid.Column="1">
  66. <Grid.RowDefinitions>
  67. <RowDefinition Height="50*" />
  68. <RowDefinition Height="5*" />
  69. <RowDefinition Height="35*" />
  70. <RowDefinition Height="30*" />
  71. </Grid.RowDefinitions>
  72. <Grid>
  73. <Grid.RowDefinitions>
  74. <RowDefinition Height="auto" />
  75. <RowDefinition Height="auto" />
  76. <RowDefinition Height="*" />
  77. </Grid.RowDefinitions>
  78. <!-- 锁付结果展示表格(插入位置) -->
  79. <materialDesign:Card
  80. Grid.Row="2"
  81. Margin="0,4"
  82. BorderBrush="LightGray"
  83. BorderThickness="1"
  84. UniformCornerRadius="10">
  85. <DockPanel Margin="8" LastChildFill="True">
  86. <TextBlock
  87. DockPanel.Dock="Top"
  88. FontSize="{DynamicResource Font.Size.Body3}"
  89. FontWeight="Bold"
  90. Text="{lex:Loc 锁付结果}" />
  91. <DataGrid
  92. x:Name="lockResultGrid"
  93. MinHeight="120"
  94. Margin="0,8,0,0"
  95. HorizontalAlignment="Stretch"
  96. VerticalAlignment="Stretch"
  97. AutoGenerateColumns="False"
  98. CanUserAddRows="False"
  99. CanUserDeleteRows="False"
  100. GridLinesVisibility="None"
  101. HeadersVisibility="Column"
  102. IsReadOnly="True"
  103. ItemsSource="{Binding LockResults}"
  104. RowHeaderWidth="0">
  105. <DataGrid.Columns>
  106. <DataGridTextColumn
  107. Width="auto"
  108. Binding="{Binding Number}"
  109. Header="#"
  110. IsReadOnly="True" />
  111. <DataGridTextColumn
  112. Width="auto"
  113. Binding="{Binding ProductName}"
  114. Header="{lex:Loc 产品名称}"
  115. IsReadOnly="True" />
  116. <DataGridTextColumn
  117. Width="auto"
  118. Binding="{Binding ProductNumber}"
  119. Header="{lex:Loc 产品编号}"
  120. IsReadOnly="True" />
  121. <DataGridTextColumn
  122. Width="auto"
  123. Binding="{Binding Timestamp, StringFormat={}{0:G}}"
  124. Header="{lex:Loc 时间}"
  125. IsReadOnly="True" />
  126. <DataGridTextColumn
  127. Width="auto"
  128. Binding="{Binding ScrewdriverProgramNumber}"
  129. Header="{lex:Loc 程序号}"
  130. IsReadOnly="True" />
  131. <DataGridTextColumn
  132. Width="auto"
  133. Binding="{Binding LockTurns, StringFormat={}{0:F1}}"
  134. Header="{lex:Loc 锁付圈数}"
  135. IsReadOnly="True" />
  136. <DataGridTextColumn
  137. Width="auto"
  138. Binding="{Binding LockTorque, StringFormat={}{0:F3}}"
  139. Header="{lex:Loc 锁付扭矩}"
  140. IsReadOnly="True" />
  141. <DataGridTemplateColumn
  142. Width="auto"
  143. Header="{lex:Loc 锁付结果}"
  144. IsReadOnly="True">
  145. <DataGridTemplateColumn.CellTemplate>
  146. <DataTemplate>
  147. <Border
  148. x:Name="bd"
  149. Padding="4"
  150. HorizontalAlignment="Center"
  151. VerticalAlignment="Center"
  152. Background="Transparent"
  153. CornerRadius="4">
  154. <TextBlock
  155. x:Name="txt"
  156. HorizontalAlignment="Center"
  157. VerticalAlignment="Center"
  158. FontWeight="Bold"
  159. Foreground="White" />
  160. </Border>
  161. <DataTemplate.Triggers>
  162. <DataTrigger Binding="{Binding LockPassed, StringFormat={}{0:F3}}" Value="True">
  163. <Setter TargetName="bd" Property="Background" Value="Green" />
  164. <Setter TargetName="txt" Property="Text" Value="OK" />
  165. </DataTrigger>
  166. <DataTrigger Binding="{Binding LockPassed, StringFormat={}{0:F3}}" Value="False">
  167. <Setter TargetName="bd" Property="Background" Value="Red" />
  168. <Setter TargetName="txt" Property="Text" Value="NG" />
  169. </DataTrigger>
  170. </DataTemplate.Triggers>
  171. </DataTemplate>
  172. </DataGridTemplateColumn.CellTemplate>
  173. </DataGridTemplateColumn>
  174. <DataGridTextColumn
  175. Width="auto"
  176. Binding="{Binding Pressure, StringFormat={}{0:F3}}"
  177. Header="{lex:Loc 压力}"
  178. IsReadOnly="True" />
  179. <DataGridTextColumn
  180. Width="auto"
  181. Binding="{Binding ResultDetails}"
  182. Header="{lex:Loc 详情}"
  183. IsReadOnly="True" />
  184. </DataGrid.Columns>
  185. </DataGrid>
  186. </DockPanel>
  187. </materialDesign:Card>
  188. <Grid Grid.Row="0">
  189. <Grid.ColumnDefinitions>
  190. <ColumnDefinition Width="*" />
  191. <ColumnDefinition Width="*" />
  192. <ColumnDefinition Width="*" />
  193. </Grid.ColumnDefinitions>
  194. <!-- 加载产品 -->
  195. <materialDesign:Card
  196. Grid.Row="0"
  197. Grid.Column="0"
  198. BorderBrush="LightGray"
  199. BorderThickness="1"
  200. UniformCornerRadius="10">
  201. <!-- 产品 -->
  202. <StackPanel
  203. Margin="2"
  204. HorizontalAlignment="Center"
  205. VerticalAlignment="Center"
  206. Orientation="Vertical">
  207. <StackPanel
  208. HorizontalAlignment="Left"
  209. VerticalAlignment="Center"
  210. Orientation="Horizontal">
  211. <TextBlock
  212. VerticalAlignment="Center"
  213. FontSize="14"
  214. Text="{lex:Loc 产品列表,
  215. Converter={StaticResource StringFormatConverter},
  216. ConverterParameter='{}{0}: '}" />
  217. <ComboBox
  218. x:Name="selectProduct"
  219. Width="100"
  220. Margin="20,0"
  221. materialDesign:HintAssist.Hint="{lex:Loc 选择产品}"
  222. FontSize="14"
  223. ItemsSource="{Binding ProductList, Mode=TwoWay}"
  224. SelectedItem="{Binding SelectProduct, Mode=TwoWay}">
  225. <ComboBox.ItemTemplate>
  226. <DataTemplate>
  227. <StackPanel Orientation="Vertical">
  228. <StackPanel Orientation="Horizontal">
  229. <materialDesign:PackIcon Kind="CubeOutline" />
  230. <TextBlock Text="{Binding Name}" />
  231. </StackPanel>
  232. <TextBlock
  233. MinHeight="0"
  234. MaxWidth="300"
  235. FontSize="{DynamicResource Font.Size.Captions4}"
  236. Foreground="Gray"
  237. Text="{Binding Description}"
  238. TextTrimming="CharacterEllipsis"
  239. TextWrapping="Wrap" />
  240. </StackPanel>
  241. </DataTemplate>
  242. </ComboBox.ItemTemplate>
  243. </ComboBox>
  244. </StackPanel>
  245. <Button
  246. Margin="0,10"
  247. materialDesign:ButtonAssist.CornerRadius="10"
  248. Command="{Binding LoadProductCommand}"
  249. CommandParameter="{Binding ElementName=selectProduct, Path=SelectedItem}"
  250. Content="{lex:Loc 加载}"
  251. Style="{StaticResource MaterialDesignRaisedButton}" />
  252. <StackPanel
  253. HorizontalAlignment="Left"
  254. VerticalAlignment="Center"
  255. Orientation="Horizontal">
  256. <TextBlock
  257. VerticalAlignment="Center"
  258. FontSize="14"
  259. Foreground="Green"
  260. Text="{lex:Loc 当前产品,
  261. Converter={StaticResource StringFormatConverter},
  262. ConverterParameter='{}{0}: '}" />
  263. <TextBlock
  264. Margin="10,0"
  265. VerticalAlignment="Center"
  266. FontSize="14"
  267. FontWeight="Bold">
  268. <TextBlock.Text>
  269. <MultiBinding StringFormat="{}{0}. {1}">
  270. <Binding Path="CurrentProduct.NumberCode" />
  271. <Binding Path="CurrentProduct.Name" />
  272. </MultiBinding>
  273. </TextBlock.Text>
  274. </TextBlock>
  275. </StackPanel>
  276. </StackPanel>
  277. </materialDesign:Card>
  278. <!-- 生产数量 -->
  279. <materialDesign:Card
  280. Grid.Row="0"
  281. Grid.Column="1"
  282. BorderBrush="LightGray"
  283. BorderThickness="1"
  284. UniformCornerRadius="10">
  285. <Grid
  286. Grid.Row="1"
  287. HorizontalAlignment="Center"
  288. VerticalAlignment="Center">
  289. <Grid.RowDefinitions>
  290. <RowDefinition Height="auto" />
  291. <RowDefinition Height="auto" />
  292. <RowDefinition Height="auto" />
  293. </Grid.RowDefinitions>
  294. <Grid.ColumnDefinitions>
  295. <ColumnDefinition Width="auto" />
  296. <ColumnDefinition Width="auto" />
  297. </Grid.ColumnDefinitions>
  298. <Grid.Resources>
  299. <Style TargetType="TextBlock">
  300. <Setter Property="FontSize" Value="14" />
  301. <Setter Property="Margin" Value="5" />
  302. <Setter Property="MinWidth" Value="50" />
  303. <Setter Property="HorizontalAlignment" Value="Center" />
  304. <Setter Property="VerticalAlignment" Value="Center" />
  305. <Setter Property="TextAlignment" Value="Center" />
  306. <Setter Property="TextTrimming" Value="CharacterEllipsis" />
  307. </Style>
  308. </Grid.Resources>
  309. <TextBlock
  310. HorizontalAlignment="Right"
  311. Text="{lex:Loc 当前产品总产量,
  312. Converter={StaticResource StringFormatConverter},
  313. ConverterParameter='{}{0}: '}"
  314. TextAlignment="Right" />
  315. <Border
  316. Grid.Row="0"
  317. Grid.Column="1"
  318. VerticalAlignment="Bottom"
  319. BorderBrush="Gray"
  320. BorderThickness="1" />
  321. <TextBlock
  322. Grid.Row="0"
  323. Grid.Column="1"
  324. Text="{Binding management.TotalQuantity}" />
  325. <TextBlock
  326. Grid.Row="1"
  327. Grid.Column="0"
  328. HorizontalAlignment="Right"
  329. Text="{lex:Loc 今日产量,
  330. Converter={StaticResource StringFormatConverter},
  331. ConverterParameter='{}{0}: '}"
  332. TextAlignment="Right" />
  333. <Border
  334. Grid.Row="1"
  335. Grid.Column="1"
  336. VerticalAlignment="Bottom"
  337. BorderBrush="Gray"
  338. BorderThickness="1" />
  339. <TextBlock
  340. Grid.Row="1"
  341. Grid.Column="1"
  342. Text="{Binding management.TotalQuantityToday}" />
  343. <TextBlock
  344. Grid.Row="2"
  345. Grid.Column="0"
  346. HorizontalAlignment="Right"
  347. Text="UPH: "
  348. TextAlignment="Right" />
  349. <Border
  350. Grid.Row="2"
  351. Grid.Column="1"
  352. VerticalAlignment="Bottom"
  353. BorderBrush="Gray"
  354. BorderThickness="1" />
  355. <TextBlock
  356. Grid.Row="2"
  357. Grid.Column="1"
  358. Text="{Binding management.CurrentUPH}" />
  359. </Grid>
  360. </materialDesign:Card>
  361. <!-- 生产数量2 -->
  362. <materialDesign:Card
  363. Grid.Row="0"
  364. Grid.Column="2"
  365. BorderBrush="LightGray"
  366. BorderThickness="1"
  367. UniformCornerRadius="10">
  368. <Grid
  369. Grid.Row="1"
  370. HorizontalAlignment="Center"
  371. VerticalAlignment="Center">
  372. <Grid.RowDefinitions>
  373. <RowDefinition Height="auto" />
  374. <RowDefinition Height="auto" />
  375. <RowDefinition Height="auto" />
  376. </Grid.RowDefinitions>
  377. <Grid.ColumnDefinitions>
  378. <ColumnDefinition Width="auto" />
  379. <ColumnDefinition Width="auto" />
  380. </Grid.ColumnDefinitions>
  381. <Grid.Resources>
  382. <Style TargetType="TextBlock">
  383. <Setter Property="FontSize" Value="14" />
  384. <Setter Property="Margin" Value="5" />
  385. <Setter Property="MinWidth" Value="50" />
  386. <Setter Property="HorizontalAlignment" Value="Center" />
  387. <Setter Property="VerticalAlignment" Value="Center" />
  388. <Setter Property="TextAlignment" Value="Center" />
  389. <Setter Property="TextTrimming" Value="CharacterEllipsis" />
  390. </Style>
  391. </Grid.Resources>
  392. <TextBlock
  393. HorizontalAlignment="Right"
  394. Text="抛料数:"
  395. TextAlignment="Right" />
  396. <Border
  397. Grid.Row="0"
  398. Grid.Column="1"
  399. VerticalAlignment="Bottom"
  400. BorderBrush="Gray"
  401. BorderThickness="1" />
  402. <TextBlock
  403. Grid.Row="0"
  404. Grid.Column="1"
  405. Text="{Binding management.ThrowNumber}" />
  406. <TextBlock
  407. Grid.Row="1"
  408. Grid.Column="0"
  409. HorizontalAlignment="Right"
  410. Text="NG数量:"
  411. TextAlignment="Right" />
  412. <Border
  413. Grid.Row="1"
  414. Grid.Column="1"
  415. VerticalAlignment="Bottom"
  416. BorderBrush="Gray"
  417. BorderThickness="1" />
  418. <TextBlock
  419. Grid.Row="1"
  420. Grid.Column="1"
  421. Text="{Binding management.NgNumber}" />
  422. <TextBlock
  423. Grid.Row="2"
  424. Grid.Column="0"
  425. HorizontalAlignment="Right"
  426. Text="良率:"
  427. TextAlignment="Right" />
  428. <Border
  429. Grid.Row="2"
  430. Grid.Column="1"
  431. VerticalAlignment="Bottom"
  432. BorderBrush="Gray"
  433. BorderThickness="1" />
  434. <TextBlock
  435. Grid.Row="2"
  436. Grid.Column="1"
  437. Text="{Binding management.Yield, StringFormat={}{0:F2}%}" />
  438. </Grid>
  439. </materialDesign:Card>
  440. </Grid>
  441. <StackPanel
  442. Grid.Row="1"
  443. Margin="10,3"
  444. VerticalAlignment="Bottom"
  445. Orientation="Horizontal">
  446. <TextBlock
  447. VerticalAlignment="Center"
  448. FontSize="{DynamicResource Font.Size.Body2}"
  449. FontWeight="Bold"
  450. Text="CT: " />
  451. <TextBlock
  452. Margin="10,0"
  453. VerticalAlignment="Center"
  454. FontSize="{DynamicResource Font.Size.Body3}"
  455. Text="{Binding management.CTtime, StringFormat={}{0:F2} s}" />
  456. </StackPanel>
  457. <StackPanel
  458. Grid.Row="1"
  459. Margin="10,3"
  460. HorizontalAlignment="Right"
  461. VerticalAlignment="Bottom"
  462. Orientation="Horizontal">
  463. <Button
  464. Margin="3"
  465. materialDesign:ButtonAssist.CornerRadius="10"
  466. Command="{Binding TorqueInspectionCommand}"
  467. Content="{lex:Loc 扭力点检}"
  468. IsEnabled="{Binding IsAllowEdit}"
  469. Style="{StaticResource MaterialDesignRaisedButton}" />
  470. <Button
  471. Margin="3"
  472. materialDesign:ButtonAssist.CornerRadius="10"
  473. Command="{Binding ResetCounterCommand}"
  474. Content="{lex:Loc 计数清零}"
  475. IsEnabled="{Binding IsAllowEdit}"
  476. Style="{StaticResource MaterialDesignRaisedButton}" />
  477. <Button
  478. Margin="3"
  479. materialDesign:ButtonAssist.CornerRadius="10"
  480. Command="{Binding AddScrewCommand}"
  481. Content="添加螺丝"
  482. Style="{StaticResource MaterialDesignRaisedButton}" />
  483. <Button
  484. Margin="3"
  485. materialDesign:ButtonAssist.CornerRadius="10"
  486. Command="{Binding ChangeHeaderCommand}"
  487. Content="更换披头"
  488. IsEnabled="{Binding IsAllowEdit}"
  489. Style="{StaticResource MaterialDesignRaisedButton}" />
  490. <Button
  491. Margin="3"
  492. materialDesign:ButtonAssist.CornerRadius="10"
  493. Command="{Binding ChangeNozzleCommand}"
  494. Content="更换吸嘴"
  495. IsEnabled="{Binding IsAllowEdit}"
  496. Style="{StaticResource MaterialDesignRaisedButton}" />
  497. </StackPanel>
  498. </Grid>
  499. <materialDesign:Card
  500. Grid.Row="1"
  501. Margin="0,0,0,2"
  502. BorderBrush="LightGray"
  503. BorderThickness="1"
  504. UniformCornerRadius="10">
  505. <Grid>
  506. <Grid.ColumnDefinitions>
  507. <ColumnDefinition />
  508. <ColumnDefinition />
  509. <ColumnDefinition />
  510. <ColumnDefinition />
  511. </Grid.ColumnDefinitions>
  512. <StackPanel
  513. Margin="3"
  514. HorizontalAlignment="Left"
  515. VerticalAlignment="Center"
  516. Orientation="Horizontal">
  517. <TextBlock
  518. Margin="0,0,10,0"
  519. FontSize="14"
  520. Text="{lex:Loc 批头}" />
  521. <TextBlock FontSize="14" Text="{Binding management.NumStatistics.HeaderNum}" />
  522. </StackPanel>
  523. <StackPanel
  524. Grid.Column="1"
  525. Margin="3"
  526. HorizontalAlignment="Left"
  527. VerticalAlignment="Center"
  528. Orientation="Horizontal">
  529. <TextBlock
  530. Margin="0,0,10,0"
  531. FontSize="14"
  532. Text="{lex:Loc 吸嘴}" />
  533. <TextBlock FontSize="14" Text="{Binding management.NumStatistics.NozzleNum}" />
  534. </StackPanel>
  535. <StackPanel
  536. Grid.Column="2"
  537. Margin="3"
  538. HorizontalAlignment="Left"
  539. VerticalAlignment="Center"
  540. Orientation="Horizontal">
  541. <TextBlock
  542. Margin="0,0,10,0"
  543. FontSize="14"
  544. Text="{lex:Loc 供料器1}" />
  545. <TextBlock FontSize="14" Text="{Binding management.NumStatistics.Feeder1Num}" />
  546. </StackPanel>
  547. <StackPanel
  548. Grid.Column="3"
  549. Margin="3"
  550. HorizontalAlignment="Left"
  551. VerticalAlignment="Center"
  552. Orientation="Horizontal">
  553. <TextBlock
  554. Margin="0,0,10,0"
  555. FontSize="14"
  556. Text="{lex:Loc 供料器2}" />
  557. <TextBlock FontSize="14" Text="{Binding management.NumStatistics.Feeder2Num}" />
  558. </StackPanel>
  559. </Grid>
  560. </materialDesign:Card>
  561. <materialDesign:Card
  562. Grid.Row="2"
  563. Margin="0,0,0,2"
  564. BorderBrush="LightGray"
  565. BorderThickness="1"
  566. UniformCornerRadius="10">
  567. <oxy:PlotView
  568. Grid.Row="1"
  569. Grid.Column="0"
  570. Margin="10"
  571. Background="Transparent"
  572. Model="{Binding LockCurvePlotModel}" />
  573. </materialDesign:Card>
  574. <materialDesign:Card
  575. Grid.Row="3"
  576. Margin="0,2,0,0"
  577. BorderBrush="LightGray"
  578. BorderThickness="1"
  579. UniformCornerRadius="10">
  580. <DockPanel Margin="10" LastChildFill="True">
  581. <TextBlock
  582. DockPanel.Dock="Top"
  583. FontSize="{DynamicResource Font.Size.Body3}"
  584. FontWeight="Bold"
  585. Text="{lex:Loc 运行信息,
  586. Converter={StaticResource StringFormatConverter},
  587. ConverterParameter='{}{0}: '}" />
  588. <ListView
  589. x:Name="messagelist"
  590. Background="Transparent"
  591. BorderThickness="0"
  592. ItemsSource="{Binding MessageQueue}"
  593. ScrollViewer.CanContentScroll="False"
  594. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  595. ScrollViewer.VerticalScrollBarVisibility="Auto">
  596. <ListView.Resources>
  597. <Style TargetType="{x:Type GridViewHeaderRowPresenter}">
  598. <Setter Property="FrameworkElement.Visibility" Value="Collapsed" />
  599. </Style>
  600. </ListView.Resources>
  601. <ListView.ItemContainerStyle>
  602. <Style TargetType="ListViewItem">
  603. <Setter Property="HorizontalContentAlignment" Value="Left" />
  604. <Setter Property="VerticalContentAlignment" Value="Top" />
  605. </Style>
  606. </ListView.ItemContainerStyle>
  607. <ListView.ItemTemplate>
  608. <DataTemplate>
  609. <Border HorizontalAlignment="Left" BorderThickness="0">
  610. <Label
  611. MaxWidth="1000"
  612. Margin="0"
  613. Padding="0"
  614. HorizontalAlignment="Left"
  615. VerticalAlignment="Center"
  616. Background="Transparent"
  617. BorderThickness="0"
  618. FontSize="10">
  619. <TextBlock
  620. FontSize="{DynamicResource Font.Size.Captions3}"
  621. Foreground="{Binding FontColol}"
  622. TextAlignment="Left"
  623. TextWrapping="Wrap">
  624. <TextBlock.Text>
  625. <MultiBinding StringFormat="{}[{0:M/d HH:mm:ss}]:{1}">
  626. <Binding Path="DT" />
  627. <Binding Path="Message" />
  628. </MultiBinding>
  629. </TextBlock.Text>
  630. </TextBlock>
  631. <Label.ContextMenu>
  632. <ContextMenu>
  633. <MenuItem
  634. Command="{Binding DataContext.CopyCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"
  635. CommandParameter="{Binding Message}"
  636. Header="Copy"
  637. Icon="{materialDesign:PackIcon Kind=ContentCopy}" />
  638. </ContextMenu>
  639. </Label.ContextMenu>
  640. </Label>
  641. </Border>
  642. </DataTemplate>
  643. </ListView.ItemTemplate>
  644. </ListView>
  645. </DockPanel>
  646. </materialDesign:Card>
  647. </Grid>
  648. </Grid>
  649. </UserControl>