终端一体化运控平台
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

213 wiersze
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 ButtonStyle}"
  109. Height="20" Width="80" HorizontalAlignment="Right" VerticalAlignment="Top"
  110. Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor},Path=DataContext.PecipeSettingCommand}"
  111. CommandParameter="{Binding ID}"/>
  112. </Grid>
  113. </Border>
  114. </Border>
  115. <ControlTemplate.Triggers>
  116. <Trigger Property="IsMouseOver" Value="True">
  117. <Setter Property="BorderBrush" Value="#4169E1" TargetName="mborder"/>
  118. <Setter Property="Opacity" Value="1" TargetName="mborder"/>
  119. </Trigger>
  120. <Trigger Property="IsFocused" Value="True">
  121. </Trigger>
  122. </ControlTemplate.Triggers>
  123. </ControlTemplate>
  124. </Setter.Value>
  125. </Setter>
  126. </Style>
  127. </UserControl.Resources>
  128. <Border>
  129. <Border.Background>
  130. <ImageBrush ImageSource="../image/中间.png"/>
  131. </Border.Background>
  132. <Grid>
  133. <Grid.RowDefinitions>
  134. <RowDefinition Height="17"/>
  135. <RowDefinition Height="40"/>
  136. <RowDefinition Height="25"/>
  137. <RowDefinition />
  138. </Grid.RowDefinitions>
  139. <TextBlock Grid.Row="1" Text="配方清单" FontSize="28" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  140. <Button Grid.Row="2" Content="工艺流程" Style="{DynamicResource CommonButton}" HorizontalAlignment="Right" Margin="20,0" Width="100"/>
  141. <ListView Grid.Row="3"
  142. ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding RecipeList}" Margin=" 10" Background="Transparent"
  143. BorderBrush="Transparent">
  144. <ListView.ContextMenu>
  145. <ContextMenu FontSize="16" Foreground="White">
  146. <MenuItem Command="{Binding CreateRecipeCommand}">
  147. <MenuItem.Header>
  148. <Grid>
  149. <Grid.ColumnDefinitions>
  150. <ColumnDefinition Width="auto"/>
  151. <ColumnDefinition Width="*"/>
  152. </Grid.ColumnDefinitions>
  153. <TextBlock Style="{DynamicResource menuText}" Text="&#xe64d;"/>
  154. <TextBlock Grid.Column="1" Text="新建配方" Style="{DynamicResource menuText}" FontFamily="楷体"/>
  155. </Grid>
  156. </MenuItem.Header>
  157. </MenuItem>
  158. <MenuItem Command="{Binding EditRecipeCommand }"
  159. CommandParameter="{Binding PlacementTarget.SelectedIndex,RelativeSource={RelativeSource AncestorType=ContextMenu}}">
  160. <MenuItem.Header>
  161. <Grid>
  162. <Grid.ColumnDefinitions>
  163. <ColumnDefinition Width="auto"/>
  164. <ColumnDefinition Width="*"/>
  165. </Grid.ColumnDefinitions>
  166. <TextBlock Style="{DynamicResource menuText}" Text="&#xf0213;"/>
  167. <TextBlock Grid.Column="1" Text="编辑配方" Style="{DynamicResource menuText}" FontFamily="楷体" />
  168. </Grid>
  169. </MenuItem.Header>
  170. </MenuItem>
  171. <MenuItem Command="{Binding DeleteRecipeCommand}"
  172. CommandParameter="{Binding PlacementTarget.SelectedIndex,RelativeSource={RelativeSource AncestorType=ContextMenu}}">
  173. <MenuItem.Header>
  174. <Grid>
  175. <Grid.ColumnDefinitions>
  176. <ColumnDefinition Width="auto"/>
  177. <ColumnDefinition Width="*"/>
  178. </Grid.ColumnDefinitions>
  179. <TextBlock Style="{DynamicResource menuText}" Text="&#xe8c1;"/>
  180. <TextBlock Grid.Column="1" Text="删除配方" Style="{DynamicResource menuText}" FontFamily="楷体" />
  181. </Grid>
  182. </MenuItem.Header>
  183. </MenuItem>
  184. </ContextMenu>
  185. </ListView.ContextMenu>
  186. <ListBox.ItemsPanel>
  187. <ItemsPanelTemplate>
  188. <WrapPanel Margin="10"/>
  189. </ItemsPanelTemplate>
  190. </ListBox.ItemsPanel>
  191. </ListView>
  192. </Grid>
  193. </Border>
  194. </UserControl>