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

NewRecipeView.xaml 12 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <Window
  2. x:Class="BPASmartClient.JXJFoodSmallStation.View.NewRecipeView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmartClient.JXJFoodSmallStation.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
  9. Title="NewRecipeView"
  10. Width="550"
  11. Height="450"
  12. AllowsTransparency="True"
  13. Background="{x:Null}"
  14. Topmost="True"
  15. WindowStartupLocation="CenterScreen"
  16. WindowStyle="None"
  17. mc:Ignorable="d">
  18. <Window.DataContext>
  19. <vm:NewRecipeViewModel />
  20. </Window.DataContext>
  21. <Window.Resources>
  22. <ResourceDictionary>
  23. <ResourceDictionary.MergedDictionaries>
  24. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
  25. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
  26. <ResourceDictionary>
  27. <!--#region ListBox样式-->
  28. <Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
  29. <Setter Property="OverridesDefaultStyle" Value="True" />
  30. <Setter Property="SnapsToDevicePixels" Value="True" />
  31. <Setter Property="BorderBrush" Value="{x:Null}" />
  32. <Setter Property="Foreground" Value="White" />
  33. <Setter Property="FontSize" Value="20" />
  34. <Setter Property="HorizontalContentAlignment" Value="Center" />
  35. <Setter Property="VerticalContentAlignment" Value="Center" />
  36. <Setter Property="Template">
  37. <Setter.Value>
  38. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  39. <Border x:Name="border" CornerRadius="8">
  40. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  41. </Border>
  42. </ControlTemplate>
  43. </Setter.Value>
  44. </Setter>
  45. </Style>
  46. <!--#endregion-->
  47. </ResourceDictionary>
  48. </ResourceDictionary.MergedDictionaries>
  49. </ResourceDictionary>
  50. </Window.Resources>
  51. <Border
  52. Name="br"
  53. BorderBrush="#0CADF5"
  54. BorderThickness="2">
  55. <Border.Background>
  56. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" />
  57. <!--<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/弹窗2.png" />-->
  58. </Border.Background>
  59. <Grid>
  60. <!--<Grid.Background>
  61. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/弹窗.png" />
  62. </Grid.Background>-->
  63. <Grid.RowDefinitions>
  64. <RowDefinition Height="5" />
  65. <RowDefinition />
  66. </Grid.RowDefinitions>
  67. <!--<Button
  68. Name="btClose"
  69. Margin="0,0,5,0"
  70. Padding="10,5"
  71. HorizontalAlignment="Right"
  72. VerticalAlignment="Center"
  73. Background="Transparent"
  74. BorderThickness="0"
  75. Content="X"
  76. FontSize="18"
  77. Foreground="White" />
  78. <Border BorderBrush="#88DDDDDD" BorderThickness="0,0,0,1" />-->
  79. <Grid Grid.Row="1">
  80. <Grid.RowDefinitions>
  81. <RowDefinition Height="40" />
  82. <RowDefinition Height="40" />
  83. <RowDefinition Height="40" />
  84. <RowDefinition />
  85. </Grid.RowDefinitions>
  86. <StackPanel Grid.Row="0"
  87. Margin="10,0,0,0"
  88. Orientation="Horizontal">
  89. <TextBlock
  90. Margin="0,0,0,0"
  91. Background="Transparent"
  92. FontSize="20"
  93. Foreground="#FF2AB2E7"
  94. Text="配方名称:" />
  95. <TextBox
  96. Width="150"
  97. Height="30"
  98. Margin="0,0,0,0"
  99. FontSize="16"
  100. Text="{Binding RecipeName}" />
  101. <TextBlock
  102. Margin="0,0,10,0"
  103. HorizontalAlignment="Right"
  104. Background="Transparent"
  105. FontSize="16"
  106. Foreground="Red"
  107. Text="{Binding ErrorInfo}" />
  108. </StackPanel>
  109. <StackPanel Grid.Row="1"
  110. Margin="10,0,0,0"
  111. Orientation="Horizontal">
  112. <TextBlock
  113. Margin="0,0,0,0"
  114. Background="Transparent"
  115. FontSize="20"
  116. Foreground="#FF2AB2E7"
  117. Text="配方编号:" />
  118. <TextBox
  119. Width="150"
  120. Height="30"
  121. Margin="0,0,0,0"
  122. FontSize="16"
  123. Text="{Binding RecipeCode}" />
  124. <TextBlock
  125. Margin="10,0,0,0"
  126. Background="Transparent"
  127. FontSize="20"
  128. Foreground="#FF2AB2E7"
  129. Text="托盘编号:" />
  130. <TextBox
  131. Width="150"
  132. Height="30"
  133. Margin="0,0,0,0"
  134. FontSize="16"
  135. Text="{Binding RecipeCode}" />
  136. </StackPanel>
  137. <StackPanel
  138. Grid.Row="2"
  139. Margin="10,0,0,0"
  140. Orientation="Horizontal">
  141. <Button
  142. Width="148"
  143. Height="30"
  144. Margin="0,0,7,0"
  145. Command="{Binding AddCommand}"
  146. Content="添加原料"
  147. Cursor="Hand" />
  148. <Button
  149. Width="80"
  150. Height="30"
  151. Command="{Binding SaveCommand}"
  152. Content="确认" />
  153. <Button
  154. Name="btClose"
  155. Width="80"
  156. Height="30"
  157. Margin="7,0,0,0"
  158. Content="取消" />
  159. </StackPanel>
  160. <ScrollViewer
  161. Grid.Row="2"
  162. Margin="5"
  163. HorizontalScrollBarVisibility="Hidden"
  164. VerticalScrollBarVisibility="Hidden">
  165. <ItemsControl ItemsSource="{Binding RawMaterials}">
  166. <ItemsControl.ItemTemplate>
  167. <DataTemplate>
  168. <RadioButton GroupName="all">
  169. <RadioButton.Template>
  170. <ControlTemplate TargetType="RadioButton">
  171. <Grid Name="gr" Height="40">
  172. <Grid.ColumnDefinitions>
  173. <ColumnDefinition />
  174. <ColumnDefinition />
  175. <ColumnDefinition Width="0.5*" />
  176. </Grid.ColumnDefinitions>
  177. <ComboBox
  178. Name="cb"
  179. Grid.Column="0"
  180. Margin="3,1"
  181. VerticalAlignment="Center"
  182. BorderBrush="#FF074B92"
  183. BorderThickness="1"
  184. FontFamily="楷体"
  185. FontSize="20"
  186. Foreground="#FF2AB2E7"
  187. IsEditable="False"
  188. ItemsSource="{Binding DataContext.RawMaterialNames, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  189. SelectedIndex="0"
  190. Style="{StaticResource ComboBoxStyle}"
  191. Text="{Binding RawMaterialName}" />
  192. <!--<TextBox
  193. Name="cb"
  194. Grid.Column="0"
  195. Margin="3,1"
  196. VerticalAlignment="Center"
  197. BorderBrush="#FF074B92"
  198. BorderThickness="1"
  199. FontFamily="楷体"
  200. FontSize="20"
  201. Foreground="#FF2AB2E7"
  202. Text="{Binding RawMaterialName}" />-->
  203. <StackPanel
  204. Grid.Column="1"
  205. VerticalAlignment="Center"
  206. Orientation="Horizontal">
  207. <TextBox
  208. Name="tb"
  209. Grid.Column="1"
  210. Width="150"
  211. Height="29"
  212. Margin="3,1"
  213. VerticalAlignment="Center"
  214. FontSize="20"
  215. Text="{Binding RawMaterialWeight}" />
  216. <TextBlock
  217. Grid.Column="1"
  218. Margin="0,0,8,4"
  219. HorizontalAlignment="Right"
  220. VerticalAlignment="Center"
  221. FontSize="20"
  222. Text="g" />
  223. </StackPanel>
  224. <Button
  225. Grid.Column="2"
  226. Width="80"
  227. Margin="25,0,0,0"
  228. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  229. CommandParameter="{Binding RawMaterialId}"
  230. Content="删除" />
  231. </Grid>
  232. </ControlTemplate>
  233. </RadioButton.Template>
  234. </RadioButton>
  235. </DataTemplate>
  236. </ItemsControl.ItemTemplate>
  237. </ItemsControl>
  238. </ScrollViewer>
  239. </Grid>
  240. </Grid>
  241. </Border>
  242. </Window>