终端一体化运控平台
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

189 satır
9.9 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.DosingSystem.View.RecipeControlView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  10. xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. mc:Ignorable="d">
  14. <UserControl.DataContext>
  15. <vm:RecipeControlViewModel />
  16. </UserControl.DataContext>
  17. <UserControl.Resources>
  18. <Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem">
  19. <Style.Resources>
  20. <!-- SelectedItem with focus -->
  21. <SolidColorBrush
  22. x:Key="{x:Static SystemColors.HighlightBrushKey}"
  23. Opacity=".4"
  24. Color="White" />
  25. <!-- SelectedItem without focus -->
  26. <SolidColorBrush
  27. x:Key="{x:Static SystemColors.ControlBrushKey}"
  28. Opacity=".4"
  29. Color="White" />
  30. </Style.Resources>
  31. <!-- 设置触发器 -->
  32. <Style.Triggers>
  33. <Trigger Property="IsMouseOver" Value="true">
  34. <Setter Property="Background" Value="White" />
  35. <Setter Property="Foreground" Value="White" />
  36. </Trigger>
  37. <Trigger Property="IsFocused" Value="true">
  38. <Setter Property="Background" Value="White" />
  39. <Setter Property="Foreground" Value="White" />
  40. </Trigger>
  41. </Style.Triggers>
  42. </Style>
  43. </UserControl.Resources>
  44. <Grid>
  45. <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
  46. <ItemsControl ItemsSource="{Binding Recipes}">
  47. <ItemsControl.ItemTemplate>
  48. <DataTemplate>
  49. <Grid Height="150" VerticalAlignment="Top">
  50. <Border
  51. Name="ShadowElement"
  52. Height="150"
  53. VerticalAlignment="Top"
  54. BorderBrush="#00BEFA"
  55. BorderThickness="2"
  56. ClipToBounds="True"
  57. CornerRadius="8">
  58. <Border.Effect>
  59. <DropShadowEffect
  60. BlurRadius="18"
  61. ShadowDepth="0"
  62. Color="#00BEFA" />
  63. </Border.Effect>
  64. </Border>
  65. <Grid>
  66. <Grid.ColumnDefinitions>
  67. <ColumnDefinition Width="auto" />
  68. <ColumnDefinition />
  69. <ColumnDefinition Width="auto" />
  70. </Grid.ColumnDefinitions>
  71. <Grid Margin="20,0,0,0">
  72. <Grid.RowDefinitions>
  73. <RowDefinition />
  74. <RowDefinition />
  75. </Grid.RowDefinitions>
  76. <TextBlock
  77. FontSize="40"
  78. Foreground="White"
  79. Text="{Binding RecipeName}" />
  80. <Button
  81. Grid.Row="1"
  82. Width="80"
  83. Height="30"
  84. HorizontalAlignment="Left"
  85. Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  86. CommandParameter="{Binding RecipeName}"
  87. Content="配方下发"
  88. IsEnabled="{Binding IsEnable}" />
  89. </Grid>
  90. <ListView
  91. Grid.Column="1"
  92. Margin="10"
  93. Background="Transparent"
  94. BorderBrush="#00BEFA"
  95. BorderThickness="2,0,2,0"
  96. ItemsSource="{Binding RawMaterials}"
  97. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  98. <ListView.ItemsPanel>
  99. <ItemsPanelTemplate>
  100. <UniformGrid
  101. HorizontalAlignment="Left"
  102. VerticalAlignment="Top"
  103. Columns="4" />
  104. </ItemsPanelTemplate>
  105. </ListView.ItemsPanel>
  106. <ListView.ItemTemplate>
  107. <DataTemplate>
  108. <StackPanel
  109. Grid.Column="1"
  110. Height="20"
  111. Margin="20,0,0,0"
  112. VerticalAlignment="Top"
  113. Orientation="Horizontal">
  114. <Ellipse
  115. Width="{Binding ElementName=n, Path=ActualHeight}"
  116. Margin="0,0,5,0"
  117. Fill="{Binding RecipeStatus, Converter={StaticResource StatusConverter}}" />
  118. <TextBlock
  119. Name="n"
  120. FontSize="16"
  121. Foreground="White"
  122. Text="{Binding RawMaterialName}" />
  123. </StackPanel>
  124. </DataTemplate>
  125. </ListView.ItemTemplate>
  126. </ListView>
  127. <StackPanel
  128. Grid.Column="2"
  129. Margin="5,0"
  130. VerticalAlignment="Center">
  131. <StackPanel Margin="0,0,0,5" Orientation="Horizontal">
  132. <Ellipse
  133. Width="{Binding ElementName=tb, Path=ActualHeight}"
  134. Margin="0,0,5,0"
  135. Fill="Green" />
  136. <TextBlock
  137. Name="tb"
  138. Foreground="#ddd"
  139. Text="准备就绪" />
  140. </StackPanel>
  141. <StackPanel Margin="0,0,0,5" Orientation="Horizontal">
  142. <Ellipse
  143. Width="{Binding ElementName=tb, Path=ActualHeight}"
  144. Margin="0,0,5,0"
  145. Fill="Yellow" />
  146. <TextBlock
  147. Name="tb1"
  148. Foreground="#ddd"
  149. Text="等待接料" />
  150. </StackPanel>
  151. <StackPanel Margin="0,0,0,5" Orientation="Horizontal">
  152. <Ellipse
  153. Width="{Binding ElementName=tb, Path=ActualHeight}"
  154. Margin="0,0,5,0"
  155. Fill="Aqua" />
  156. <TextBlock
  157. Name="tb2"
  158. Foreground="#ddd"
  159. Text="接料完成" />
  160. </StackPanel>
  161. <StackPanel Margin="0,0,0,5" Orientation="Horizontal">
  162. <Ellipse
  163. Width="{Binding ElementName=tb, Path=ActualHeight}"
  164. Margin="0,0,5,0"
  165. Fill="Red" />
  166. <TextBlock
  167. Name="tb3"
  168. Foreground="#ddd"
  169. Text="设备异常" />
  170. </StackPanel>
  171. </StackPanel>
  172. </Grid>
  173. </Grid>
  174. </DataTemplate>
  175. </ItemsControl.ItemTemplate>
  176. </ItemsControl>
  177. </ScrollViewer>
  178. </Grid>
  179. </UserControl>