终端一体化运控平台
Você não pode selecionar mais de 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.

RecipeView.xaml 11 KiB

2 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <UserControl
  2. x:Class="BPASmartClient.SmallBatchingSystem.Views.RecipeView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:con="clr-namespace:BPASmartClient.SmallBatchingSystem.Converter"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:BPASmartClient.SmallBatchingSystem.Views"
  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.SmallBatchingSystem.ViewModels"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. mc:Ignorable="d">
  14. <UserControl.DataContext>
  15. <vm:RecipeViewModel />
  16. </UserControl.DataContext>
  17. <Grid Margin="10">
  18. <Grid.RowDefinitions>
  19. <RowDefinition Height="40" />
  20. <RowDefinition />
  21. </Grid.RowDefinitions>
  22. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  23. <Button
  24. Width="150"
  25. Height="40"
  26. Margin="10,0,10,0"
  27. Command="{Binding AddCommand}"
  28. Content="新建配方"
  29. FontSize="20"
  30. Style="{StaticResource ImageButtonStyle}" />
  31. <Button
  32. Width="150"
  33. Height="40"
  34. Margin="10,0,10,0"
  35. Command="{Binding SaveCommand}"
  36. Content="保存配方"
  37. FontSize="20"
  38. Style="{StaticResource ImageButtonStyle}" />
  39. </StackPanel>
  40. <Grid Grid.Row="1">
  41. <ListBox
  42. Grid.Row="2"
  43. Margin="5"
  44. VerticalAlignment="Top"
  45. Background="Transparent"
  46. BorderThickness="0"
  47. ItemsSource="{Binding RecipeInfoModels}"
  48. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  49. <ListBox.ItemsPanel>
  50. <ItemsPanelTemplate>
  51. <!--<UniformGrid
  52. HorizontalAlignment="Left"
  53. VerticalAlignment="Top"
  54. Columns="8" />-->
  55. <WrapPanel Orientation="Horizontal" />
  56. </ItemsPanelTemplate>
  57. </ListBox.ItemsPanel>
  58. <ListBox.ItemTemplate>
  59. <DataTemplate>
  60. <Grid
  61. Name="tt"
  62. Width="180"
  63. Height="220"
  64. Margin="5">
  65. <Grid.RowDefinitions>
  66. <RowDefinition Height="30" />
  67. <RowDefinition Height="20" />
  68. <RowDefinition Height="128" />
  69. <RowDefinition Height="2" />
  70. <RowDefinition Height="40" />
  71. </Grid.RowDefinitions>
  72. <Image
  73. Grid.RowSpan="5"
  74. Source="/BPASmartClient.CustomResource;component/Image/配方背景/竖背景框.png"
  75. Stretch="Fill" />
  76. <TextBlock
  77. Grid.Row="0"
  78. Margin="2,5,0,0"
  79. HorizontalAlignment="Center"
  80. VerticalAlignment="Top"
  81. FontSize="18"
  82. Foreground="#FF2AB2E7"
  83. Text="{Binding RecipeName}" />
  84. <TextBlock
  85. Grid.Row="1"
  86. Margin="5,0,0,0"
  87. VerticalAlignment="Top"
  88. Foreground="#FF2AB2E7"
  89. Text="配方信息:" />
  90. <ScrollViewer
  91. Grid.Row="2"
  92. VerticalAlignment="Top"
  93. Background="Transparent"
  94. HorizontalScrollBarVisibility="Hidden"
  95. VerticalScrollBarVisibility="Hidden">
  96. <Grid>
  97. <Grid.ColumnDefinitions>
  98. <ColumnDefinition Width="auto" />
  99. <ColumnDefinition />
  100. </Grid.ColumnDefinitions>
  101. <ItemsControl ItemsSource="{Binding SiloInfoModels}">
  102. <ItemsControl.ItemTemplate>
  103. <DataTemplate>
  104. <Grid Width="150">
  105. <Grid.ColumnDefinitions>
  106. <ColumnDefinition />
  107. <ColumnDefinition Width="0.1*" />
  108. <ColumnDefinition />
  109. </Grid.ColumnDefinitions>
  110. <TextBlock
  111. Margin="5,0,0,0"
  112. HorizontalAlignment="Right"
  113. VerticalAlignment="Center"
  114. Foreground="#aa2AB2E7"
  115. Text="{Binding SiloName}" />
  116. <TextBlock
  117. Grid.Column="1"
  118. Margin="1,0,0,0"
  119. HorizontalAlignment="Center"
  120. VerticalAlignment="Center"
  121. Foreground="#aa2AB2E7"
  122. Text=":" />
  123. <TextBlock
  124. Grid.Column="2"
  125. Margin="5,0,0,0"
  126. HorizontalAlignment="Left"
  127. VerticalAlignment="Center"
  128. Foreground="#aa2AB2E7"
  129. Text="{Binding SiloWeight}" />
  130. </Grid>
  131. </DataTemplate>
  132. </ItemsControl.ItemTemplate>
  133. </ItemsControl>
  134. </Grid>
  135. </ScrollViewer>
  136. <Image
  137. Grid.Row="3"
  138. Width="{Binding ElementName=tt, Path=ActualWidth}"
  139. Height="2"
  140. VerticalAlignment="Bottom"
  141. Source="/BPASmartClient.CustomResource;component/Image/直线.png"
  142. Stretch="Fill" />
  143. <Grid
  144. Name="gr"
  145. Grid.Row="4"
  146. Height="30"
  147. Margin="0,0,0,10"
  148. VerticalAlignment="Bottom"
  149. Background="Transparent">
  150. <Grid.ColumnDefinitions>
  151. <ColumnDefinition />
  152. <ColumnDefinition />
  153. </Grid.ColumnDefinitions>
  154. <Image
  155. Grid.ColumnSpan="2"
  156. Width="{Binding ElementName=gr, Path=ActualWidth}"
  157. Height="2"
  158. VerticalAlignment="Top"
  159. Source="/BPASmartClient.CustomResource;component/Image/直线.png" />
  160. <pry:IcoButton
  161. Width="{Binding ElementName=gr, Path=ActualWidth}"
  162. Height="{Binding ElementName=gr, Path=ActualHeight}"
  163. Margin="4,4,3,0"
  164. HorizontalAlignment="Center"
  165. VerticalAlignment="Center"
  166. Background="#11F53F62"
  167. BorderThickness="0"
  168. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  169. CommandParameter="{Binding RecipeName}"
  170. Content="删除"
  171. EnterBackground="#22F53F62"
  172. FontStyle="Normal"
  173. Foreground="#FFF53F62"
  174. IcoText="&#xe68e;"
  175. Style="{StaticResource IcoButtonStyle}" />
  176. <pry:IcoButton
  177. Grid.Column="1"
  178. Width="{Binding ElementName=gr, Path=ActualWidth}"
  179. Height="{Binding ElementName=gr, Path=ActualHeight}"
  180. Margin="3,4,4,0"
  181. HorizontalAlignment="Center"
  182. VerticalAlignment="Center"
  183. Background="#112AB2E7"
  184. BorderThickness="0"
  185. Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  186. CommandParameter="{Binding RecipeName}"
  187. Content="编辑"
  188. EnterBackground="#222AB2E7"
  189. Foreground="#FF2AB2E7"
  190. IcoText="&#xe636;"
  191. Style="{StaticResource IcoButtonStyle}" />
  192. </Grid>
  193. <!--</StackPanel>-->
  194. </Grid>
  195. </DataTemplate>
  196. </ListBox.ItemTemplate>
  197. </ListBox>
  198. </Grid>
  199. </Grid>
  200. </UserControl>