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

NewRecipeView.xaml 10 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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 Name="br" BorderThickness="1">
  52. <Border.Background>
  53. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" />
  54. </Border.Background>
  55. <Grid>
  56. <Grid.RowDefinitions>
  57. <RowDefinition Height="5" />
  58. <RowDefinition />
  59. </Grid.RowDefinitions>
  60. <!--<Button
  61. Name="btClose"
  62. Margin="0,0,5,0"
  63. Padding="10,5"
  64. HorizontalAlignment="Right"
  65. VerticalAlignment="Center"
  66. Background="Transparent"
  67. BorderThickness="0"
  68. Content="X"
  69. FontSize="18"
  70. Foreground="White" />
  71. <Border BorderBrush="#88DDDDDD" BorderThickness="0,0,0,1" />-->
  72. <Grid Grid.Row="1">
  73. <Grid.RowDefinitions>
  74. <RowDefinition Height="40" />
  75. <RowDefinition Height="40" />
  76. <RowDefinition />
  77. </Grid.RowDefinitions>
  78. <TextBlock
  79. Margin="10,0,0,0"
  80. Background="Transparent"
  81. FontSize="20"
  82. Foreground="#FF2AB2E7"
  83. Text="请输入配方名称:" />
  84. <TextBlock
  85. Margin="0,0,10,0"
  86. HorizontalAlignment="Right"
  87. Background="Transparent"
  88. FontSize="16"
  89. Foreground="Red"
  90. Text="{Binding ErrorInfo}" />
  91. <StackPanel
  92. Grid.Row="1"
  93. Margin="10,0,0,0"
  94. Orientation="Horizontal">
  95. <TextBox
  96. Grid.Column="1"
  97. Width="200"
  98. Height="30"
  99. Margin="0,0,7,0"
  100. FontSize="16"
  101. Text="{Binding RecipeName}" />
  102. <Button
  103. Width="148"
  104. Height="30"
  105. Margin="0,0,7,0"
  106. Command="{Binding AddCommand}"
  107. Content="添加原料"
  108. Cursor="Hand" />
  109. <Button
  110. Width="80"
  111. Height="30"
  112. Command="{Binding SaveCommand}"
  113. Content="确认" />
  114. <Button
  115. Name="btClose"
  116. Width="80"
  117. Height="30"
  118. Margin="7,0,0,0"
  119. Content="取消" />
  120. </StackPanel>
  121. <ScrollViewer Grid.Row="2" Margin="5">
  122. <ItemsControl ItemsSource="{Binding RawMaterials}">
  123. <ItemsControl.ItemTemplate>
  124. <DataTemplate>
  125. <RadioButton GroupName="all">
  126. <RadioButton.Template>
  127. <ControlTemplate TargetType="RadioButton">
  128. <Grid Name="gr" Height="40">
  129. <Grid.ColumnDefinitions>
  130. <ColumnDefinition />
  131. <ColumnDefinition />
  132. <ColumnDefinition Width="0.5*" />
  133. </Grid.ColumnDefinitions>
  134. <ComboBox
  135. Name="cb"
  136. Grid.Column="0"
  137. Margin="3,1"
  138. VerticalAlignment="Center"
  139. BorderBrush="#FF074B92"
  140. BorderThickness="1"
  141. FontFamily="楷体"
  142. FontSize="20"
  143. Foreground="#FF2AB2E7"
  144. IsEditable="False"
  145. ItemsSource="{Binding DataContext.RawMaterialNames, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  146. SelectedIndex="0"
  147. Style="{StaticResource ComboBoxStyle}"
  148. Text="{Binding RawMaterialName}" />
  149. <!--<TextBox
  150. Name="cb"
  151. Grid.Column="0"
  152. Margin="3,1"
  153. VerticalAlignment="Center"
  154. BorderBrush="#FF074B92"
  155. BorderThickness="1"
  156. FontFamily="楷体"
  157. FontSize="20"
  158. Foreground="#FF2AB2E7"
  159. Text="{Binding RawMaterialName}" />-->
  160. <StackPanel
  161. Grid.Column="1"
  162. VerticalAlignment="Center"
  163. Orientation="Horizontal">
  164. <TextBox
  165. Name="tb"
  166. Grid.Column="1"
  167. Width="150"
  168. Height="29"
  169. Margin="3,1"
  170. VerticalAlignment="Center"
  171. FontSize="20"
  172. Text="{Binding RawMaterialWeight}" />
  173. <TextBlock
  174. Grid.Column="1"
  175. Margin="0,0,8,4"
  176. HorizontalAlignment="Right"
  177. VerticalAlignment="Center"
  178. FontSize="20"
  179. Text="g" />
  180. </StackPanel>
  181. <Button
  182. Grid.Column="2"
  183. Margin="10,0,10,0"
  184. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  185. CommandParameter="{Binding RawMaterialId}"
  186. Content="删除" />
  187. </Grid>
  188. </ControlTemplate>
  189. </RadioButton.Template>
  190. </RadioButton>
  191. </DataTemplate>
  192. </ItemsControl.ItemTemplate>
  193. </ItemsControl>
  194. </ScrollViewer>
  195. </Grid>
  196. </Grid>
  197. </Border>
  198. </Window>