终端一体化运控平台
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

216 linhas
12 KiB

  1. <UserControl x:Class="BPASmart.RecipeManagement.View.RecipeManager"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmart.RecipeManagement.View"
  7. xmlns:vm="clr-namespace:BPASmart.RecipeManagement.ViewModel"
  8. mc:Ignorable="d"
  9. d:DesignHeight="450" d:DesignWidth="800" Foreground="#FF2AB2E7">
  10. <UserControl.DataContext>
  11. <vm:RecipeManagerViewModel/>
  12. </UserControl.DataContext>
  13. <UserControl.Resources>
  14. <Style TargetType="ListViewItem" >
  15. <Setter Property="Margin" Value="10"/>
  16. <Setter Property="Template">
  17. <Setter.Value>
  18. <ControlTemplate TargetType="ListViewItem">
  19. <Border x:Name="mborder" BorderThickness="1" Background="Transparent"
  20. Opacity="0.6" Margin="10" Padding="2"
  21. >
  22. <Border Margin="4">
  23. <Border.Background>
  24. <ImageBrush ImageSource="../image/外边框1.png" />
  25. </Border.Background>
  26. <Grid
  27. Name="tt"
  28. Height="200"
  29. Width="150"
  30. Margin="5">
  31. <Grid.RowDefinitions>
  32. <RowDefinition Height="30" />
  33. <RowDefinition Height="20" />
  34. <RowDefinition Height="128" />
  35. <RowDefinition Height="2" />
  36. <RowDefinition Height="40" />
  37. </Grid.RowDefinitions>
  38. <TextBlock
  39. Grid.Row="0"
  40. Margin="2,5,0,0"
  41. HorizontalAlignment="Center"
  42. VerticalAlignment="Top"
  43. FontSize="18"
  44. Foreground="Orange"
  45. Text="{Binding Name}" />
  46. <TextBlock
  47. Grid.Row="1"
  48. Margin="5,0,0,0"
  49. VerticalAlignment="Top"
  50. Foreground="White"
  51. Text="配方信息:" />
  52. <ScrollViewer
  53. Grid.Row="2"
  54. VerticalAlignment="Top"
  55. Background="Transparent"
  56. HorizontalScrollBarVisibility="Hidden"
  57. VerticalScrollBarVisibility="Hidden">
  58. <Grid>
  59. <Grid.ColumnDefinitions>
  60. <ColumnDefinition Width="auto" />
  61. <ColumnDefinition />
  62. </Grid.ColumnDefinitions>
  63. <ItemsControl ItemsSource="{Binding recipeMaterials}">
  64. <ItemsControl.ItemTemplate>
  65. <DataTemplate>
  66. <Grid>
  67. <TextBlock
  68. Grid.Row="1"
  69. Margin="5,0,0,0"
  70. HorizontalAlignment="Right"
  71. VerticalAlignment="Center"
  72. Foreground="#FF2AB2E7"
  73. Text="{Binding Name}" />
  74. </Grid>
  75. </DataTemplate>
  76. </ItemsControl.ItemTemplate>
  77. </ItemsControl>
  78. <ItemsControl Grid.Column="1"
  79. VerticalAlignment="Center"
  80. VerticalContentAlignment="Center" ItemsSource="{Binding recipeMaterials}">
  81. <ItemsControl.ItemTemplate>
  82. <DataTemplate>
  83. <StackPanel Orientation="Horizontal">
  84. <TextBlock
  85. Margin="5,0,0,0"
  86. HorizontalAlignment="Center"
  87. VerticalAlignment="Center"
  88. Foreground="#FF2AB2E7"
  89. Text=":" />
  90. <TextBlock
  91. Margin="5,0,0,0"
  92. HorizontalAlignment="Center"
  93. VerticalAlignment="Center"
  94. Foreground="#FF2AB2E7"
  95. Text="{Binding MaterialWeight}" />
  96. <TextBlock
  97. Margin="5,0,0,0"
  98. HorizontalAlignment="Center"
  99. VerticalAlignment="Center"
  100. Foreground="#FF2AB2E7"
  101. Text="g" />
  102. </StackPanel>
  103. </DataTemplate>
  104. </ItemsControl.ItemTemplate>
  105. </ItemsControl>
  106. </Grid>
  107. </ScrollViewer>
  108. <Button Grid.Row="4" Content="配方下发" Style="{DynamicResource GreenButton}" BorderBrush="Green" BorderThickness="1"
  109. Height="20" Width="70" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,0,5,0"
  110. Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor},Path=DataContext.PecipeStartCommand}"
  111. CommandParameter="{Binding ID}"/>
  112. <Button Grid.Row="4" Content="配方工艺" Style="{DynamicResource ButtonStyle}"
  113. Height="20" Width="70" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5,0,0,0"
  114. Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor},Path=DataContext.PecipeSettingCommand}"
  115. CommandParameter="{Binding ID}"/>
  116. </Grid>
  117. </Border>
  118. </Border>
  119. <ControlTemplate.Triggers>
  120. <Trigger Property="IsMouseOver" Value="True">
  121. <Setter Property="BorderBrush" Value="#4169E1" TargetName="mborder"/>
  122. <Setter Property="Opacity" Value="1" TargetName="mborder"/>
  123. </Trigger>
  124. <Trigger Property="IsFocused" Value="True">
  125. </Trigger>
  126. </ControlTemplate.Triggers>
  127. </ControlTemplate>
  128. </Setter.Value>
  129. </Setter>
  130. </Style>
  131. </UserControl.Resources>
  132. <Border>
  133. <Border.Background>
  134. <ImageBrush ImageSource="../image/中间.png"/>
  135. </Border.Background>
  136. <Grid>
  137. <Grid.RowDefinitions>
  138. <RowDefinition Height="17"/>
  139. <RowDefinition Height="40"/>
  140. <RowDefinition Height="25"/>
  141. <RowDefinition />
  142. </Grid.RowDefinitions>
  143. <TextBlock Grid.Row="1" Text="配方清单" FontSize="28" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  144. <Button Grid.Row="2" Content="工艺流程" Style="{DynamicResource CommonButton}" HorizontalAlignment="Right" Margin="20,0" Width="100"/>
  145. <ListView Grid.Row="3"
  146. ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding RecipeList}" Margin=" 10" Background="Transparent"
  147. BorderBrush="Transparent">
  148. <ListView.ContextMenu>
  149. <ContextMenu FontSize="16" Foreground="White">
  150. <MenuItem Command="{Binding CreateRecipeCommand}">
  151. <MenuItem.Header>
  152. <Grid>
  153. <Grid.ColumnDefinitions>
  154. <ColumnDefinition Width="auto"/>
  155. <ColumnDefinition Width="*"/>
  156. </Grid.ColumnDefinitions>
  157. <TextBlock Style="{DynamicResource menuText}" Text="&#xe64d;"/>
  158. <TextBlock Grid.Column="1" Text="新建配方" Style="{DynamicResource menuText}" FontFamily="楷体"/>
  159. </Grid>
  160. </MenuItem.Header>
  161. </MenuItem>
  162. <MenuItem Command="{Binding EditRecipeCommand }"
  163. CommandParameter="{Binding PlacementTarget.SelectedIndex,RelativeSource={RelativeSource AncestorType=ContextMenu}}">
  164. <MenuItem.Header>
  165. <Grid>
  166. <Grid.ColumnDefinitions>
  167. <ColumnDefinition Width="auto"/>
  168. <ColumnDefinition Width="*"/>
  169. </Grid.ColumnDefinitions>
  170. <TextBlock Style="{DynamicResource menuText}" Text="&#xf0213;"/>
  171. <TextBlock Grid.Column="1" Text="编辑配方" Style="{DynamicResource menuText}" FontFamily="楷体" />
  172. </Grid>
  173. </MenuItem.Header>
  174. </MenuItem>
  175. <MenuItem Command="{Binding DeleteRecipeCommand}"
  176. CommandParameter="{Binding PlacementTarget.SelectedIndex,RelativeSource={RelativeSource AncestorType=ContextMenu}}">
  177. <MenuItem.Header>
  178. <Grid>
  179. <Grid.ColumnDefinitions>
  180. <ColumnDefinition Width="auto"/>
  181. <ColumnDefinition Width="*"/>
  182. </Grid.ColumnDefinitions>
  183. <TextBlock Style="{DynamicResource menuText}" Text="&#xe8c1;"/>
  184. <TextBlock Grid.Column="1" Text="删除配方" Style="{DynamicResource menuText}" FontFamily="楷体" />
  185. </Grid>
  186. </MenuItem.Header>
  187. </MenuItem>
  188. </ContextMenu>
  189. </ListView.ContextMenu>
  190. <ListBox.ItemsPanel>
  191. <ItemsPanelTemplate>
  192. <WrapPanel Margin="10"/>
  193. </ItemsPanelTemplate>
  194. </ListBox.ItemsPanel>
  195. </ListView>
  196. </Grid>
  197. </Border>
  198. </UserControl>