HomeView.xaml 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  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="600"
  17. d:Width="1024"
  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="*" />
  38. <!--<RowDefinition Height="*" />-->
  39. </Grid.RowDefinitions>
  40. <!-- 图像 -->
  41. <local:ShowVisionRender Grid.Row="0" Grid.Column="0" />
  42. <!-- 曲线图 -->
  43. <!--<oxy:PlotView Grid.Row="1"
  44. Grid.Column="0"
  45. Model="{Binding LockCurvePlotModel}"
  46. Background="Transparent"
  47. Margin="10" />-->
  48. </Grid>
  49. <Grid
  50. x:Name="zzz"
  51. Grid.Row="1"
  52. Grid.Column="1">
  53. <Grid.RowDefinitions>
  54. <RowDefinition Height="60*" />
  55. <RowDefinition Height="40*" />
  56. </Grid.RowDefinitions>
  57. <Grid>
  58. <Grid.RowDefinitions>
  59. <RowDefinition Height="*" />
  60. <RowDefinition Height="auto" />
  61. <RowDefinition Height="auto" />
  62. </Grid.RowDefinitions>
  63. <Grid>
  64. <Grid.ColumnDefinitions>
  65. <ColumnDefinition Width="80*" />
  66. <ColumnDefinition Width="auto" />
  67. </Grid.ColumnDefinitions>
  68. <!-- 锁付结果展示表格(插入位置) -->
  69. <materialDesign:Card
  70. Grid.Row="0"
  71. Margin="0,4"
  72. BorderBrush="LightGray"
  73. BorderThickness="1"
  74. UniformCornerRadius="10">
  75. <DockPanel Margin="8" LastChildFill="True">
  76. <Border
  77. Height="24"
  78. Margin="0,0,0,8"
  79. BorderThickness="1"
  80. CornerRadius="6"
  81. DockPanel.Dock="Top">
  82. <Border.Style>
  83. <Style TargetType="Border">
  84. <Setter Property="Background" Value="#9E9E9E" />
  85. <Setter Property="BorderBrush" Value="#9E9E9E" />
  86. <Style.Triggers>
  87. <DataTrigger Binding="{Binding management.FinalResultStatus}" Value="OK">
  88. <Setter Property="Background" Value="#4CAF50" />
  89. <Setter Property="BorderBrush" Value="#4CAF50" />
  90. </DataTrigger>
  91. <DataTrigger Binding="{Binding management.FinalResultStatus}" Value="NG">
  92. <Setter Property="Background" Value="#F44336" />
  93. <Setter Property="BorderBrush" Value="#F44336" />
  94. </DataTrigger>
  95. </Style.Triggers>
  96. </Style>
  97. </Border.Style>
  98. <TextBlock
  99. HorizontalAlignment="Center"
  100. VerticalAlignment="Center"
  101. FontSize="14"
  102. FontWeight="Bold"
  103. Foreground="White"
  104. Text="{Binding management.FinalResultText, FallbackValue=检测中}"
  105. TextAlignment="Center" />
  106. </Border>
  107. <TextBlock
  108. DockPanel.Dock="Top"
  109. FontSize="{DynamicResource Font.Size.Body3}"
  110. FontWeight="Bold"
  111. Text="{lex:Loc 拍照结果}" />
  112. <DataGrid
  113. x:Name="lockResultGrid"
  114. MinHeight="120"
  115. Margin="0,8,0,0"
  116. HorizontalAlignment="Stretch"
  117. VerticalAlignment="Stretch"
  118. AutoGenerateColumns="False"
  119. CanUserAddRows="False"
  120. CanUserDeleteRows="False"
  121. GridLinesVisibility="None"
  122. HeadersVisibility="Column"
  123. IsReadOnly="True"
  124. ItemsSource="{Binding LockResults}"
  125. RowHeaderWidth="0">
  126. <DataGrid.Columns>
  127. <DataGridTextColumn
  128. Width="auto"
  129. Binding="{Binding PhotoName}"
  130. Header="#"
  131. IsReadOnly="True" />
  132. <DataGridTextColumn
  133. Width="auto"
  134. Binding="{Binding PhotoCode}"
  135. Header="{lex:Loc 产品编号}"
  136. IsReadOnly="True" />
  137. <DataGridTextColumn
  138. Width="auto"
  139. Binding="{Binding Timestamp, StringFormat={}{0:G}}"
  140. Header="{lex:Loc 时间}"
  141. IsReadOnly="True" />
  142. <DataGridTextColumn
  143. Width="auto"
  144. Binding="{Binding ResultData}"
  145. Header="{lex:Loc 测量数据}"
  146. IsReadOnly="True" />
  147. <!--<DataGridTextColumn Header="程序号"
  148. Binding="{Binding ScrewdriverProgramNumber}"
  149. Width="auto"
  150. IsReadOnly="True" />
  151. <DataGridTextColumn Header="锁付圈数"
  152. Binding="{Binding LockTurns}"
  153. Width="auto"
  154. IsReadOnly="True" />
  155. <DataGridTextColumn Header="锁付扭矩"
  156. Binding="{Binding LockTorque}"
  157. Width="auto"
  158. IsReadOnly="True" />-->
  159. <DataGridTemplateColumn
  160. Width="auto"
  161. Header="{lex:Loc 拍照结果}"
  162. IsReadOnly="True">
  163. <DataGridTemplateColumn.CellTemplate>
  164. <DataTemplate>
  165. <Border
  166. x:Name="bd"
  167. Padding="4"
  168. HorizontalAlignment="Center"
  169. VerticalAlignment="Center"
  170. Background="Transparent"
  171. CornerRadius="4">
  172. <TextBlock
  173. x:Name="txt"
  174. HorizontalAlignment="Center"
  175. VerticalAlignment="Center"
  176. FontWeight="Bold"
  177. Foreground="White" />
  178. </Border>
  179. <DataTemplate.Triggers>
  180. <DataTrigger Binding="{Binding PhotoPassed}" Value="OK">
  181. <Setter TargetName="bd" Property="Background" Value="Green" />
  182. <Setter TargetName="txt" Property="Text" Value="OK" />
  183. </DataTrigger>
  184. <DataTrigger Binding="{Binding PhotoPassed}" Value="NG">
  185. <Setter TargetName="bd" Property="Background" Value="Red" />
  186. <Setter TargetName="txt" Property="Text" Value="NG" />
  187. </DataTrigger>
  188. </DataTemplate.Triggers>
  189. </DataTemplate>
  190. </DataGridTemplateColumn.CellTemplate>
  191. </DataGridTemplateColumn>
  192. <DataGridTextColumn
  193. Width="auto"
  194. Binding="{Binding Detail}"
  195. Header="{lex:Loc 详情}"
  196. IsReadOnly="True" />
  197. </DataGrid.Columns>
  198. </DataGrid>
  199. </DockPanel>
  200. </materialDesign:Card>
  201. <StackPanel
  202. Grid.Column="1"
  203. Margin="5"
  204. HorizontalAlignment="Center"
  205. Orientation="Vertical"
  206. Visibility="{Binding DataContext.IsShowLabel, ElementName=zzz, Converter={StaticResource BooleanToVisibilityConverter}}" />
  207. </Grid>
  208. <Grid Grid.Row="1">
  209. <Grid.ColumnDefinitions>
  210. <ColumnDefinition Width="*" />
  211. <ColumnDefinition Width="*" />
  212. </Grid.ColumnDefinitions>
  213. <!-- 加载产品 -->
  214. <materialDesign:Card
  215. Grid.Row="0"
  216. Grid.Column="0"
  217. BorderBrush="LightGray"
  218. BorderThickness="1"
  219. UniformCornerRadius="10">
  220. <!-- 产品 -->
  221. <StackPanel
  222. Margin="2"
  223. HorizontalAlignment="Center"
  224. VerticalAlignment="Center"
  225. Orientation="Vertical">
  226. <StackPanel
  227. HorizontalAlignment="Left"
  228. VerticalAlignment="Center"
  229. Orientation="Horizontal">
  230. <TextBlock
  231. VerticalAlignment="Center"
  232. FontSize="14"
  233. Text="{lex:Loc 产品列表,
  234. Converter={StaticResource StringFormatConverter},
  235. ConverterParameter='{}{0}: '}" />
  236. <ComboBox
  237. x:Name="selectProduct"
  238. Width="100"
  239. Margin="20,0"
  240. materialDesign:HintAssist.Hint="{lex:Loc 选择产品}"
  241. FontSize="14"
  242. ItemsSource="{Binding ProductList, Mode=TwoWay}"
  243. SelectedItem="{Binding SelectProduct, Mode=TwoWay}">
  244. <ComboBox.ItemTemplate>
  245. <DataTemplate>
  246. <StackPanel Orientation="Vertical">
  247. <StackPanel Orientation="Horizontal">
  248. <materialDesign:PackIcon Kind="CubeOutline" />
  249. <TextBlock Text="{Binding Name}" />
  250. </StackPanel>
  251. <TextBlock
  252. MinHeight="0"
  253. MaxWidth="300"
  254. FontSize="{DynamicResource Font.Size.Captions4}"
  255. Foreground="Gray"
  256. Text="{Binding Description}"
  257. TextTrimming="CharacterEllipsis"
  258. TextWrapping="Wrap" />
  259. </StackPanel>
  260. </DataTemplate>
  261. </ComboBox.ItemTemplate>
  262. </ComboBox>
  263. </StackPanel>
  264. <Button
  265. Margin="0,10"
  266. materialDesign:ButtonAssist.CornerRadius="10"
  267. Command="{Binding LoadProductCommand}"
  268. CommandParameter="{Binding ElementName=selectProduct, Path=SelectedItem}"
  269. Content="{lex:Loc 加载}"
  270. Style="{StaticResource MaterialDesignRaisedButton}" />
  271. <StackPanel
  272. HorizontalAlignment="Left"
  273. VerticalAlignment="Center"
  274. Orientation="Horizontal">
  275. <TextBlock
  276. VerticalAlignment="Center"
  277. FontSize="14"
  278. Foreground="Green"
  279. Text="{lex:Loc 当前产品,
  280. Converter={StaticResource StringFormatConverter},
  281. ConverterParameter='{}{0}: '}" />
  282. <TextBlock
  283. Margin="10,0"
  284. VerticalAlignment="Center"
  285. FontSize="14"
  286. FontWeight="Bold">
  287. <TextBlock.Text>
  288. <MultiBinding StringFormat="{}{0}. {1}">
  289. <Binding Path="CurrentProduct.NumberCode" />
  290. <Binding Path="CurrentProduct.Name" />
  291. </MultiBinding>
  292. </TextBlock.Text>
  293. </TextBlock>
  294. </StackPanel>
  295. </StackPanel>
  296. </materialDesign:Card>
  297. <!-- 生产数量 -->
  298. <materialDesign:Card
  299. Grid.Row="0"
  300. Grid.Column="1"
  301. BorderBrush="LightGray"
  302. BorderThickness="1"
  303. UniformCornerRadius="10">
  304. <Grid
  305. Grid.Row="1"
  306. HorizontalAlignment="Center"
  307. VerticalAlignment="Center">
  308. <Grid.RowDefinitions>
  309. <RowDefinition Height="auto" />
  310. <RowDefinition Height="auto" />
  311. <RowDefinition Height="auto" />
  312. </Grid.RowDefinitions>
  313. <Grid.ColumnDefinitions>
  314. <ColumnDefinition Width="auto" />
  315. <ColumnDefinition Width="auto" />
  316. </Grid.ColumnDefinitions>
  317. <Grid.Resources>
  318. <Style TargetType="TextBlock">
  319. <Setter Property="FontSize" Value="14" />
  320. <Setter Property="Margin" Value="5" />
  321. <Setter Property="MinWidth" Value="50" />
  322. <Setter Property="HorizontalAlignment" Value="Center" />
  323. <Setter Property="VerticalAlignment" Value="Center" />
  324. <Setter Property="TextAlignment" Value="Center" />
  325. <Setter Property="TextTrimming" Value="CharacterEllipsis" />
  326. </Style>
  327. </Grid.Resources>
  328. <TextBlock
  329. HorizontalAlignment="Right"
  330. Text="{lex:Loc 当前产品总产量,
  331. Converter={StaticResource StringFormatConverter},
  332. ConverterParameter='{}{0}: '}"
  333. TextAlignment="Right" />
  334. <Border
  335. Grid.Row="0"
  336. Grid.Column="1"
  337. VerticalAlignment="Bottom"
  338. BorderBrush="Gray"
  339. BorderThickness="1" />
  340. <TextBlock
  341. Grid.Row="0"
  342. Grid.Column="1"
  343. Text="{Binding management.TotalQuantity}" />
  344. <TextBlock
  345. Grid.Row="1"
  346. Grid.Column="0"
  347. HorizontalAlignment="Right"
  348. Text="{lex:Loc 今日产量,
  349. Converter={StaticResource StringFormatConverter},
  350. ConverterParameter='{}{0}: '}"
  351. TextAlignment="Right" />
  352. <Border
  353. Grid.Row="1"
  354. Grid.Column="1"
  355. VerticalAlignment="Bottom"
  356. BorderBrush="Gray"
  357. BorderThickness="1" />
  358. <TextBlock
  359. Grid.Row="1"
  360. Grid.Column="1"
  361. Text="{Binding management.TotalQuantityToday}" />
  362. <TextBlock
  363. Grid.Row="2"
  364. Grid.Column="0"
  365. HorizontalAlignment="Right"
  366. Text="UPH:"
  367. TextAlignment="Right" />
  368. <Border
  369. Grid.Row="2"
  370. Grid.Column="1"
  371. VerticalAlignment="Bottom"
  372. BorderBrush="Gray"
  373. BorderThickness="1" />
  374. <TextBlock
  375. Grid.Row="2"
  376. Grid.Column="1"
  377. Text="{Binding management.CurrentUPH}" />
  378. </Grid>
  379. </materialDesign:Card>
  380. <!-- OK/NG -->
  381. <!--
  382. <materialDesign:Card Grid.Row="0"
  383. Grid.Column="2"
  384. UniformCornerRadius="10"
  385. BorderBrush="LightGray"
  386. BorderThickness="1">
  387. <Grid Grid.Row="1"
  388. HorizontalAlignment="Center"
  389. VerticalAlignment="Center">
  390. <Grid.RowDefinitions>
  391. <RowDefinition Height="auto" />
  392. <RowDefinition Height="auto" />
  393. <RowDefinition Height="auto" />
  394. </Grid.RowDefinitions>
  395. <Grid.ColumnDefinitions>
  396. <ColumnDefinition Width="auto" />
  397. <ColumnDefinition Width="auto" />
  398. </Grid.ColumnDefinitions>
  399. <Grid.Resources>
  400. <Style TargetType="TextBlock">
  401. <Setter Property="FontSize"
  402. Value="14" />
  403. <Setter Property="Margin"
  404. Value="5" />
  405. <Setter Property="MinWidth"
  406. Value="50" />
  407. <Setter Property="HorizontalAlignment"
  408. Value="Center" />
  409. <Setter Property="VerticalAlignment"
  410. Value="Center" />
  411. <Setter Property="TextAlignment"
  412. Value="Center" />
  413. <Setter Property="TextTrimming"
  414. Value="CharacterEllipsis" />
  415. </Style>
  416. </Grid.Resources>
  417. -->
  418. <!--<TextBlock Text="{lex:Loc 抛料数,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  419. HorizontalAlignment="Right"
  420. TextAlignment="Right" />
  421. <Border Grid.Row="0"
  422. Grid.Column="1"
  423. VerticalAlignment="Bottom"
  424. BorderBrush="Gray"
  425. BorderThickness="1" />
  426. <TextBlock Grid.Row="0"
  427. Grid.Column="1"
  428. Text="" />
  429. <TextBlock Grid.Row="1"
  430. Grid.Column="0"
  431. Text="{lex:Loc NG数量,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  432. HorizontalAlignment="Right"
  433. TextAlignment="Right" />
  434. <Border Grid.Row="1"
  435. Grid.Column="1"
  436. VerticalAlignment="Bottom"
  437. BorderBrush="Gray"
  438. BorderThickness="1" />
  439. <TextBlock Grid.Row="1"
  440. Grid.Column="1"
  441. Text="{Binding management.NgNumber}" />
  442. <TextBlock Grid.Row="2"
  443. Grid.Column="0"
  444. Text="{lex:Loc 良率}"
  445. HorizontalAlignment="Right"
  446. TextAlignment="Right" />
  447. <Border Grid.Row="2"
  448. Grid.Column="1"
  449. VerticalAlignment="Bottom"
  450. BorderBrush="Gray"
  451. BorderThickness="1" />
  452. <TextBlock Grid.Row="2"
  453. Grid.Column="1"
  454. Text="{Binding management.Yield,StringFormat={}{0:F2}%}" />-->
  455. <!--
  456. </Grid>
  457. </materialDesign:Card>-->
  458. </Grid>
  459. <StackPanel
  460. Grid.Row="2"
  461. Margin="10,3"
  462. VerticalAlignment="Bottom"
  463. Orientation="Horizontal">
  464. <TextBlock
  465. VerticalAlignment="Center"
  466. FontSize="{DynamicResource Font.Size.Body2}"
  467. FontWeight="Bold"
  468. Text="CT: " />
  469. <TextBlock
  470. Margin="10,0,50,0"
  471. VerticalAlignment="Center"
  472. FontSize="{DynamicResource Font.Size.Body3}"
  473. Text="{Binding management.CTtime, StringFormat={}{0:F2} s}" />
  474. <TextBlock
  475. VerticalAlignment="Center"
  476. FontSize="{DynamicResource Font.Size.Body2}"
  477. FontWeight="Bold"
  478. Text="CT2: " />
  479. <TextBlock
  480. Margin="10,0"
  481. VerticalAlignment="Center"
  482. FontSize="{DynamicResource Font.Size.Body3}"
  483. Text="{Binding management.CTtime2, StringFormat={}{0:F2} s}" />
  484. </StackPanel>
  485. <!--<CheckBox Grid.Row="2"
  486. VerticalAlignment="Bottom"
  487. Margin=" 120,3"
  488. HorizontalAlignment="Right"
  489. Content="虚拟SN"
  490. IsEnabled="{Binding IsRunning, Converter={StaticResource InvertBooleanConverter}}"
  491. IsChecked="{Binding IsNoCode, Mode=TwoWay, Converter={StaticResource InvertBooleanConverter}}" />
  492. <CheckBox Grid.Row="2"
  493. VerticalAlignment="Bottom"
  494. Margin="0,0,180,3"
  495. HorizontalAlignment="Right"
  496. Content="检测结果为1"
  497. IsEnabled="{Binding IsRunning, Converter={StaticResource InvertBooleanConverter}}"
  498. IsChecked="{Binding IsResultTrue, Mode=TwoWay, Converter={StaticResource InvertBooleanConverter}}" Width="98" />-->
  499. <Button
  500. Grid.Row="2"
  501. Margin="10,3"
  502. HorizontalAlignment="Right"
  503. VerticalAlignment="Bottom"
  504. materialDesign:ButtonAssist.CornerRadius="10"
  505. Command="{Binding ResetCounterCommand}"
  506. Content="{lex:Loc 计数清零}"
  507. IsEnabled="{Binding IsAllowEdit}"
  508. Style="{StaticResource MaterialDesignRaisedButton}" />
  509. </Grid>
  510. <Border
  511. Grid.Row="1"
  512. BorderBrush="#787878"
  513. BorderThickness="1"
  514. CornerRadius="20">
  515. <DockPanel Margin="10" LastChildFill="True">
  516. <TextBlock
  517. DockPanel.Dock="Top"
  518. FontSize="{DynamicResource Font.Size.Body3}"
  519. FontWeight="Bold"
  520. Text="{lex:Loc 运行信息,
  521. Converter={StaticResource StringFormatConverter},
  522. ConverterParameter='{}{0}: '}" />
  523. <ListView
  524. x:Name="messagelist"
  525. Background="Transparent"
  526. BorderThickness="0"
  527. ItemsSource="{Binding MessageQueue}"
  528. ScrollViewer.CanContentScroll="False"
  529. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  530. ScrollViewer.VerticalScrollBarVisibility="Auto">
  531. <ListView.Resources>
  532. <Style TargetType="{x:Type GridViewHeaderRowPresenter}">
  533. <Setter Property="FrameworkElement.Visibility" Value="Collapsed" />
  534. </Style>
  535. </ListView.Resources>
  536. <ListView.ItemContainerStyle>
  537. <Style TargetType="ListViewItem">
  538. <Setter Property="HorizontalContentAlignment" Value="Left" />
  539. <Setter Property="VerticalContentAlignment" Value="Top" />
  540. </Style>
  541. </ListView.ItemContainerStyle>
  542. <ListView.ItemTemplate>
  543. <DataTemplate>
  544. <Border HorizontalAlignment="Left" BorderThickness="0">
  545. <Label
  546. Width="auto"
  547. Margin="0"
  548. Padding="0"
  549. HorizontalAlignment="Left"
  550. VerticalAlignment="Center"
  551. Background="Transparent"
  552. BorderThickness="0"
  553. FontSize="10">
  554. <TextBlock
  555. FontSize="{DynamicResource Font.Size.Captions3}"
  556. Foreground="{Binding FontColol}"
  557. TextAlignment="Left"
  558. TextWrapping="Wrap">
  559. <TextBlock.Text>
  560. <MultiBinding StringFormat="{}[{0:M/d HH:mm:ss}]:{1}">
  561. <Binding Path="DT" />
  562. <Binding Path="Message" />
  563. </MultiBinding>
  564. </TextBlock.Text>
  565. </TextBlock>
  566. <Label.ContextMenu>
  567. <ContextMenu>
  568. <MenuItem
  569. Command="{Binding DataContext.CopyCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"
  570. CommandParameter="{Binding Message}"
  571. Header="Copy"
  572. Icon="{materialDesign:PackIcon Kind=ContentCopy}" />
  573. </ContextMenu>
  574. </Label.ContextMenu>
  575. </Label>
  576. </Border>
  577. </DataTemplate>
  578. </ListView.ItemTemplate>
  579. </ListView>
  580. </DockPanel>
  581. </Border>
  582. </Grid>
  583. </Grid>
  584. </UserControl>