终端一体化运控平台
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.
 
 
 

263 rivejä
13 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 Margin="20">
  45. <ScrollViewer>
  46. <ListView
  47. Margin="5"
  48. VerticalAlignment="Top"
  49. Background="Transparent"
  50. BorderThickness="0"
  51. ItemsSource="{Binding Recipes}"
  52. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  53. <ListView.ItemsPanel>
  54. <ItemsPanelTemplate>
  55. <UniformGrid
  56. HorizontalAlignment="Left"
  57. VerticalAlignment="Top"
  58. Columns="8" />
  59. </ItemsPanelTemplate>
  60. </ListView.ItemsPanel>
  61. <ListView.ItemTemplate>
  62. <DataTemplate>
  63. <Border Margin="5" Background="LightSkyBlue">
  64. <Grid>
  65. <Grid.RowDefinitions>
  66. <RowDefinition />
  67. <RowDefinition Height="0.25*" />
  68. <RowDefinition Height="0.2*" />
  69. </Grid.RowDefinitions>
  70. <Image Source="/BPASmartClient.CustomResource;component/Image/AGV/炒锅.png" />
  71. <TextBlock
  72. Grid.Row="1"
  73. Margin="2,0,0,0"
  74. HorizontalAlignment="Center"
  75. VerticalAlignment="Center"
  76. Foreground="#dd000000"
  77. Text="{Binding RecipeName}" />
  78. <Grid
  79. Name="gr"
  80. Grid.Row="2"
  81. Height="30"
  82. Background="#00BEFA">
  83. <pry:IcoButton
  84. Width="{Binding ElementName=gr, Path=ActualWidth}"
  85. Height="{Binding ElementName=gr, Path=ActualHeight}"
  86. HorizontalAlignment="Center"
  87. VerticalAlignment="Center"
  88. BorderThickness="0"
  89. Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  90. CommandParameter="{Binding RecipeName}"
  91. Content="订单下发"
  92. EnterBackground="Red"
  93. FontStyle="Normal"
  94. Foreground="#dd000000"
  95. IcoText="&#xe6cf;"
  96. IsEnabled="{Binding IsEnable}"
  97. Style="{StaticResource IcoButtonStyle}" />
  98. </Grid>
  99. </Grid>
  100. </Border>
  101. </DataTemplate>
  102. </ListView.ItemTemplate>
  103. </ListView>
  104. <!--<ItemsControl ItemsSource="{Binding Recipes}">
  105. <ItemsControl.ItemTemplate>
  106. <DataTemplate>
  107. <Grid
  108. Height="150"
  109. Margin="0,0,0,50"
  110. VerticalAlignment="Top">
  111. <Border
  112. Name="ShadowElement"
  113. Height="150"
  114. VerticalAlignment="Top"
  115. BorderBrush="#00BEFA"
  116. BorderThickness="2"
  117. ClipToBounds="True"
  118. CornerRadius="8">
  119. <Border.Effect>
  120. <DropShadowEffect
  121. BlurRadius="18"
  122. ShadowDepth="0"
  123. Color="#00BEFA" />
  124. </Border.Effect>
  125. </Border>
  126. <Grid>
  127. <Grid.ColumnDefinitions>
  128. <ColumnDefinition Width="200" />
  129. <ColumnDefinition />
  130. <ColumnDefinition Width="100" />
  131. </Grid.ColumnDefinitions>
  132. <Grid Margin="20,0,0,0">
  133. <Grid.RowDefinitions>
  134. <RowDefinition />
  135. <RowDefinition />
  136. </Grid.RowDefinitions>
  137. <TextBlock
  138. FontSize="40"
  139. Foreground="White"
  140. Text="{Binding RecipeName}" />
  141. <Button
  142. Grid.Row="1"
  143. Width="80"
  144. Height="30"
  145. HorizontalAlignment="Left"
  146. Background="#00BEFA"
  147. Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  148. CommandParameter="{Binding RecipeName}"
  149. Content="配方下发"
  150. IsEnabled="{Binding IsEnable}" />
  151. </Grid>
  152. <ListView
  153. Grid.Column="1"
  154. Margin="10"
  155. Background="Transparent"
  156. BorderBrush="#00BEFA"
  157. BorderThickness="2,0,2,0"
  158. ItemsSource="{Binding RawMaterials}"
  159. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  160. <ListView.ItemsPanel>
  161. <ItemsPanelTemplate>
  162. <UniformGrid
  163. HorizontalAlignment="Left"
  164. VerticalAlignment="Top"
  165. Columns="4" />
  166. </ItemsPanelTemplate>
  167. </ListView.ItemsPanel>
  168. <ListView.ItemTemplate>
  169. <DataTemplate>
  170. <StackPanel
  171. Grid.Column="1"
  172. Height="20"
  173. Margin="20,0,0,0"
  174. VerticalAlignment="Top"
  175. Orientation="Horizontal">
  176. <Ellipse
  177. Width="{Binding ElementName=n, Path=ActualHeight}"
  178. Margin="0,0,5,0"
  179. Fill="{Binding RecipeStatus, Converter={StaticResource StatusConverter}}" />
  180. <TextBlock
  181. Name="n"
  182. FontSize="16"
  183. Foreground="White"
  184. Text="{Binding RawMaterialName}" />
  185. </StackPanel>
  186. </DataTemplate>
  187. </ListView.ItemTemplate>
  188. </ListView>
  189. <StackPanel
  190. Grid.Column="2"
  191. Margin="5,0"
  192. VerticalAlignment="Center">
  193. <StackPanel Margin="0,0,0,5" Orientation="Horizontal">
  194. <Ellipse
  195. Width="{Binding ElementName=tb, Path=ActualHeight}"
  196. Margin="0,0,5,0"
  197. Fill="Green" />
  198. <TextBlock
  199. Name="tb"
  200. Foreground="#ddd"
  201. Text="准备就绪" />
  202. </StackPanel>
  203. <StackPanel Margin="0,0,0,5" Orientation="Horizontal">
  204. <Ellipse
  205. Width="{Binding ElementName=tb, Path=ActualHeight}"
  206. Margin="0,0,5,0"
  207. Fill="Yellow" />
  208. <TextBlock
  209. Name="tb1"
  210. Foreground="#ddd"
  211. Text="等待接料" />
  212. </StackPanel>
  213. <StackPanel Margin="0,0,0,5" Orientation="Horizontal">
  214. <Ellipse
  215. Width="{Binding ElementName=tb, Path=ActualHeight}"
  216. Margin="0,0,5,0"
  217. Fill="Aqua" />
  218. <TextBlock
  219. Name="tb2"
  220. Foreground="#ddd"
  221. Text="接料完成" />
  222. </StackPanel>
  223. <StackPanel Margin="0,0,0,5" Orientation="Horizontal">
  224. <Ellipse
  225. Width="{Binding ElementName=tb, Path=ActualHeight}"
  226. Margin="0,0,5,0"
  227. Fill="Red" />
  228. <TextBlock
  229. Name="tb3"
  230. Foreground="#ddd"
  231. Text="设备异常" />
  232. </StackPanel>
  233. </StackPanel>
  234. </Grid>
  235. </Grid>
  236. </DataTemplate>
  237. </ItemsControl.ItemTemplate>
  238. </ItemsControl>-->
  239. </ScrollViewer>
  240. </Grid>
  241. </UserControl>