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

280 linhas
13 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="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. <ColumnDefinition Width="0.7*" />
  139. </Grid.ColumnDefinitions>
  140. <TextBlock
  141. Grid.Column="0"
  142. Style="{StaticResource TitleTextblockStyle}"
  143. Text="原料名称" />
  144. <Grid Grid.Column="1">
  145. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="桶号" />
  146. <Border
  147. BorderBrush="{StaticResource bordColor}"
  148. BorderThickness="1,0,1,0"
  149. Cursor="SizeWE" />
  150. </Grid>
  151. <TextBlock
  152. Grid.Column="2"
  153. Style="{StaticResource TitleTextblockStyle}"
  154. Text="重量" />
  155. <Grid Grid.Column="3">
  156. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="删除" />
  157. <Border
  158. BorderBrush="{StaticResource bordColor}"
  159. BorderThickness="1,0,1,0"
  160. Cursor="SizeWE" />
  161. </Grid>
  162. <Border
  163. Grid.ColumnSpan="10"
  164. BorderBrush="{StaticResource bordColor}"
  165. BorderThickness="1,0,1,0" />
  166. </Grid>
  167. <!--#endregion-->
  168. <ScrollViewer
  169. Grid.Row="3"
  170. Margin="5,0"
  171. HorizontalScrollBarVisibility="Hidden"
  172. VerticalScrollBarVisibility="Hidden">
  173. <ItemsControl ItemsSource="{Binding RawMaterials}">
  174. <ItemsControl.ItemTemplate>
  175. <DataTemplate>
  176. <RadioButton GroupName="all">
  177. <RadioButton.Template>
  178. <ControlTemplate TargetType="RadioButton">
  179. <Grid Name="gr" Height="35">
  180. <Grid.ColumnDefinitions>
  181. <ColumnDefinition />
  182. <ColumnDefinition Width="0.7*" />
  183. <ColumnDefinition Width="0.7*" />
  184. <ColumnDefinition Width="0.7*" />
  185. </Grid.ColumnDefinitions>
  186. <ComboBox
  187. Name="cb"
  188. Grid.Column="0"
  189. Height="{Binding ElementName=gr, Path=ActualHeight}"
  190. VerticalAlignment="Center"
  191. BorderBrush="#FF074B92"
  192. BorderThickness="1"
  193. FontFamily="楷体"
  194. FontSize="20"
  195. Foreground="#FF2AB2E7"
  196. IsEditable="False"
  197. ItemsSource="{Binding DataContext.RawMaterialNames, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  198. SelectedIndex="{Binding SelectIndex}"
  199. SelectionChanged="cb_SelectionChanged"
  200. Style="{StaticResource ComboBoxStyle}"
  201. Text="{Binding RawMaterialName}" />
  202. <TextBox
  203. Grid.Column="1"
  204. Height="{Binding ElementName=gr, Path=ActualHeight}"
  205. VerticalAlignment="Center"
  206. FontSize="20"
  207. Foreground="#FF2AB2E7"
  208. Text="{Binding Loc}" />
  209. <TextBox
  210. Name="tb"
  211. Grid.Column="2"
  212. Height="{Binding ElementName=gr, Path=ActualHeight}"
  213. VerticalAlignment="Center"
  214. FontSize="20"
  215. Foreground="#FF2AB2E7"
  216. Text="{Binding RawMaterialWeight}" />
  217. <TextBlock
  218. Grid.Column="2"
  219. Margin="0,0,8,4"
  220. HorizontalAlignment="Right"
  221. VerticalAlignment="Center"
  222. FontSize="20"
  223. Foreground="#FF2AB2E7"
  224. Text="g" />
  225. <Button
  226. Grid.Column="3"
  227. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  228. CommandParameter="{Binding RawMaterialId}"
  229. Content="删除"
  230. FontSize="16"
  231. Style="{StaticResource ControlButtonStyle}" />
  232. </Grid>
  233. </ControlTemplate>
  234. </RadioButton.Template>
  235. </RadioButton>
  236. </DataTemplate>
  237. </ItemsControl.ItemTemplate>
  238. </ItemsControl>
  239. </ScrollViewer>
  240. </Grid>
  241. </Grid>
  242. </Border>
  243. </Window>