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

NewRecipeView.xaml 11 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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 />
  84. </Grid.RowDefinitions>
  85. <TextBlock
  86. Margin="10,0,0,0"
  87. Background="Transparent"
  88. FontSize="20"
  89. Foreground="#FF2AB2E7"
  90. Text="请输入配方名称:" />
  91. <TextBlock
  92. Margin="0,0,10,0"
  93. HorizontalAlignment="Right"
  94. Background="Transparent"
  95. FontSize="16"
  96. Foreground="Red"
  97. Text="{Binding ErrorInfo}" />
  98. <StackPanel
  99. Grid.Row="1"
  100. Margin="10,0,0,0"
  101. Orientation="Horizontal">
  102. <TextBox
  103. Grid.Column="1"
  104. Width="200"
  105. Height="30"
  106. Margin="0,0,7,0"
  107. FontSize="16"
  108. Text="{Binding RecipeName}" />
  109. <Button
  110. Width="148"
  111. Height="30"
  112. Margin="0,0,7,0"
  113. Command="{Binding AddCommand}"
  114. Content="添加原料"
  115. Cursor="Hand" />
  116. <Button
  117. Width="80"
  118. Height="30"
  119. Command="{Binding SaveCommand}"
  120. Content="确认" />
  121. <Button
  122. Name="btClose"
  123. Width="80"
  124. Height="30"
  125. Margin="7,0,0,0"
  126. Content="取消" />
  127. </StackPanel>
  128. <ScrollViewer
  129. Grid.Row="2"
  130. Margin="5"
  131. HorizontalScrollBarVisibility="Hidden"
  132. VerticalScrollBarVisibility="Hidden">
  133. <ItemsControl ItemsSource="{Binding RawMaterials}">
  134. <ItemsControl.ItemTemplate>
  135. <DataTemplate>
  136. <RadioButton GroupName="all">
  137. <RadioButton.Template>
  138. <ControlTemplate TargetType="RadioButton">
  139. <Grid Name="gr" Height="40">
  140. <Grid.ColumnDefinitions>
  141. <ColumnDefinition />
  142. <ColumnDefinition />
  143. <ColumnDefinition Width="0.5*" />
  144. </Grid.ColumnDefinitions>
  145. <ComboBox
  146. Name="cb"
  147. Grid.Column="0"
  148. Margin="3,1"
  149. VerticalAlignment="Center"
  150. BorderBrush="#FF074B92"
  151. BorderThickness="1"
  152. FontFamily="楷体"
  153. FontSize="20"
  154. Foreground="#FF2AB2E7"
  155. IsEditable="False"
  156. ItemsSource="{Binding DataContext.RawMaterialNames, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  157. SelectedIndex="0"
  158. Style="{StaticResource ComboBoxStyle}"
  159. Text="{Binding RawMaterialName}" />
  160. <!--<TextBox
  161. Name="cb"
  162. Grid.Column="0"
  163. Margin="3,1"
  164. VerticalAlignment="Center"
  165. BorderBrush="#FF074B92"
  166. BorderThickness="1"
  167. FontFamily="楷体"
  168. FontSize="20"
  169. Foreground="#FF2AB2E7"
  170. Text="{Binding RawMaterialName}" />-->
  171. <StackPanel
  172. Grid.Column="1"
  173. VerticalAlignment="Center"
  174. Orientation="Horizontal">
  175. <TextBox
  176. Name="tb"
  177. Grid.Column="1"
  178. Width="150"
  179. Height="29"
  180. Margin="3,1"
  181. VerticalAlignment="Center"
  182. FontSize="20"
  183. Text="{Binding RawMaterialWeight}" />
  184. <TextBlock
  185. Grid.Column="1"
  186. Margin="0,0,8,4"
  187. HorizontalAlignment="Right"
  188. VerticalAlignment="Center"
  189. FontSize="20"
  190. Text="g" />
  191. </StackPanel>
  192. <Button
  193. Grid.Column="2"
  194. Width="80"
  195. Margin="25,0,0,0"
  196. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  197. CommandParameter="{Binding RawMaterialId}"
  198. Content="删除" />
  199. </Grid>
  200. </ControlTemplate>
  201. </RadioButton.Template>
  202. </RadioButton>
  203. </DataTemplate>
  204. </ItemsControl.ItemTemplate>
  205. </ItemsControl>
  206. </ScrollViewer>
  207. </Grid>
  208. </Grid>
  209. </Border>
  210. </Window>