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

223 line
10 KiB

  1. <Window
  2. x:Class="BPASmartClient.DosingSystem.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.DosingSystem.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.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="添加原料" Cursor="Hand" />
  108. <Button
  109. Width="80"
  110. Height="30"
  111. Command="{Binding SaveCommand}"
  112. Content="确认" />
  113. <Button
  114. Name="btClose"
  115. Width="80"
  116. Height="30"
  117. Margin="7,0,0,0"
  118. Content="取消" />
  119. </StackPanel>
  120. <ScrollViewer Grid.Row="2" Margin="5">
  121. <ItemsControl ItemsSource="{Binding RawMaterials}">
  122. <ItemsControl.ItemTemplate>
  123. <DataTemplate>
  124. <RadioButton GroupName="all">
  125. <RadioButton.Template>
  126. <ControlTemplate TargetType="RadioButton">
  127. <Grid Name="gr" Height="40">
  128. <Grid.ColumnDefinitions>
  129. <ColumnDefinition />
  130. <ColumnDefinition />
  131. <ColumnDefinition Width="0.5*" />
  132. </Grid.ColumnDefinitions>
  133. <ComboBox
  134. Name="cb"
  135. Grid.Column="0"
  136. Margin="3,1"
  137. VerticalAlignment="Center"
  138. BorderBrush="#FF074B92"
  139. BorderThickness="1"
  140. FontFamily="楷体"
  141. FontSize="20"
  142. Foreground="#FF2AB2E7"
  143. IsEditable="False"
  144. ItemsSource="{Binding DataContext.RawMaterialNames, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  145. SelectedIndex="0"
  146. Style="{StaticResource ComboBoxStyle}"
  147. Text="{Binding RawMaterialName}" />
  148. <!--<TextBox
  149. Name="cb"
  150. Grid.Column="0"
  151. Margin="3,1"
  152. VerticalAlignment="Center"
  153. BorderBrush="#FF074B92"
  154. BorderThickness="1"
  155. FontFamily="楷体"
  156. FontSize="20"
  157. Foreground="#FF2AB2E7"
  158. Text="{Binding RawMaterialName}" />-->
  159. <StackPanel
  160. Grid.Column="1"
  161. VerticalAlignment="Center"
  162. Orientation="Horizontal">
  163. <TextBox
  164. Name="tb"
  165. Grid.Column="1"
  166. Width="150"
  167. Height="29"
  168. Margin="3,1"
  169. VerticalAlignment="Center"
  170. FontSize="20"
  171. Text="{Binding RawMaterialWeight}" />
  172. <TextBlock
  173. Grid.Column="1"
  174. Margin="0,0,8,4"
  175. HorizontalAlignment="Right"
  176. VerticalAlignment="Center"
  177. Text="mg" />
  178. </StackPanel>
  179. <Button
  180. Grid.Column="2"
  181. Margin="10,0,10,0"
  182. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  183. CommandParameter="{Binding RawMaterialId}"
  184. Content="删除" />
  185. </Grid>
  186. </ControlTemplate>
  187. </RadioButton.Template>
  188. </RadioButton>
  189. </DataTemplate>
  190. </ItemsControl.ItemTemplate>
  191. </ItemsControl>
  192. </ScrollViewer>
  193. </Grid>
  194. </Grid>
  195. </Border>
  196. </Window>