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

266 lines
12 KiB

  1. <Window
  2. x:Class="BPASmartClient.DosingSystemSingle.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.DosingSystemSingle.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:vm="clr-namespace:BPASmartClient.DosingSystemSingle.ViewModel"
  9. Title="NewRecipeView"
  10. Width="550"
  11. Height="600"
  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="30" />
  84. <RowDefinition />
  85. </Grid.RowDefinitions>
  86. <TextBlock
  87. Margin="10,0,0,0"
  88. Background="Transparent"
  89. FontSize="20"
  90. Foreground="#FF2AB2E7"
  91. Text="请输入配方名称:" />
  92. <TextBlock
  93. Margin="0,0,10,0"
  94. HorizontalAlignment="Right"
  95. Background="Transparent"
  96. FontSize="16"
  97. Foreground="Red"
  98. Text="{Binding ErrorInfo}" />
  99. <StackPanel
  100. Grid.Row="1"
  101. Margin="10,0,0,0"
  102. Orientation="Horizontal">
  103. <TextBox
  104. Grid.Column="1"
  105. Width="200"
  106. Height="30"
  107. Margin="0,0,7,0"
  108. FontSize="16"
  109. Text="{Binding RecipeName}" />
  110. <Button
  111. Width="148"
  112. Height="30"
  113. Margin="0,0,7,0"
  114. Command="{Binding AddCommand}"
  115. Content="添加原料"
  116. Cursor="Hand" />
  117. <Button
  118. Width="80"
  119. Height="30"
  120. Command="{Binding SaveCommand}"
  121. Content="确认" />
  122. <Button
  123. Name="btClose"
  124. Width="80"
  125. Height="30"
  126. Margin="7,0,0,0"
  127. Content="取消" />
  128. </StackPanel>
  129. <!--#region 表格标题栏设置-->
  130. <Grid
  131. Grid.Row="2"
  132. Margin="5,0"
  133. Background="#ff0C255F">
  134. <Grid.ColumnDefinitions>
  135. <ColumnDefinition />
  136. <ColumnDefinition Width="0.7*" />
  137. <ColumnDefinition Width="0.7*" />
  138. </Grid.ColumnDefinitions>
  139. <TextBlock
  140. Grid.Column="0"
  141. Style="{StaticResource TitleTextblockStyle}"
  142. Text="原料名称" />
  143. <Border
  144. BorderBrush="{StaticResource bordColor}"
  145. BorderThickness="1,0,1,0"
  146. Cursor="SizeWE" />
  147. <TextBlock
  148. Grid.Column="1"
  149. Style="{StaticResource TitleTextblockStyle}"
  150. Text="重量" />
  151. <Grid Grid.Column="2">
  152. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="删除" />
  153. <Border
  154. BorderBrush="{StaticResource bordColor}"
  155. BorderThickness="1,0,1,0"
  156. Cursor="SizeWE" />
  157. </Grid>
  158. <Border
  159. Grid.ColumnSpan="10"
  160. BorderBrush="{StaticResource bordColor}"
  161. BorderThickness="1,0,1,0" />
  162. </Grid>
  163. <!--#endregion-->
  164. <ScrollViewer
  165. Grid.Row="3"
  166. Margin="5,0"
  167. HorizontalScrollBarVisibility="Hidden"
  168. VerticalScrollBarVisibility="Hidden">
  169. <ItemsControl ItemsSource="{Binding RawMaterials}">
  170. <ItemsControl.ItemTemplate>
  171. <DataTemplate>
  172. <RadioButton GroupName="all">
  173. <RadioButton.Template>
  174. <ControlTemplate TargetType="RadioButton">
  175. <Grid Name="gr" Height="35">
  176. <Grid.ColumnDefinitions>
  177. <ColumnDefinition />
  178. <!--<ColumnDefinition Width="0.7*" />-->
  179. <ColumnDefinition Width="0.7*" />
  180. <ColumnDefinition Width="0.7*" />
  181. </Grid.ColumnDefinitions>
  182. <ComboBox
  183. Name="cb"
  184. Grid.Column="0"
  185. Height="{Binding ElementName=gr, Path=ActualHeight}"
  186. VerticalAlignment="Center"
  187. BorderBrush="#FF074B92"
  188. BorderThickness="1"
  189. FontFamily="楷体"
  190. FontSize="20"
  191. Foreground="#FF2AB2E7"
  192. IsEditable="False"
  193. ItemsSource="{Binding DataContext.RawMaterialNames, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  194. SelectedIndex="{Binding SelectIndex}"
  195. SelectionChanged="cb_SelectionChanged"
  196. Style="{StaticResource ComboBoxStyle}"
  197. Text="{Binding RawMaterialName}" />
  198. <TextBox
  199. Name="tb"
  200. Grid.Column="1"
  201. Height="{Binding ElementName=gr, Path=ActualHeight}"
  202. VerticalAlignment="Center"
  203. FontSize="20"
  204. Foreground="#FF2AB2E7"
  205. Text="{Binding RawMaterialWeight}" />
  206. <TextBlock
  207. Grid.Column="1"
  208. Margin="0,0,8,4"
  209. HorizontalAlignment="Right"
  210. VerticalAlignment="Center"
  211. FontSize="20"
  212. Foreground="#FF2AB2E7"
  213. Text="g" />
  214. <Button
  215. Grid.Column="2"
  216. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  217. CommandParameter="{Binding RawMaterialId}"
  218. Content="删除"
  219. FontSize="16"
  220. Style="{StaticResource ControlButtonStyle}" />
  221. </Grid>
  222. </ControlTemplate>
  223. </RadioButton.Template>
  224. </RadioButton>
  225. </DataTemplate>
  226. </ItemsControl.ItemTemplate>
  227. </ItemsControl>
  228. </ScrollViewer>
  229. </Grid>
  230. </Grid>
  231. </Border>
  232. </Window>