终端一体化运控平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

371 行
17 KiB

  1. <Window
  2. x:Class="BPASmartClient.Academy.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.Academy.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:vm="clr-namespace:BPASmartClient.Academy.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. <Style x:Key="closeBtn" TargetType="Button">
  48. <Setter Property="Background" Value="Transparent" />
  49. <Setter Property="Template">
  50. <Setter.Value>
  51. <ControlTemplate TargetType="Button">
  52. <Grid Name="gr">
  53. <TextBlock
  54. HorizontalAlignment="Center"
  55. VerticalAlignment="Center"
  56. FontFamily="/BPASmartClient.CustomResource;component/Fonts/#iconfont"
  57. FontSize="30"
  58. Foreground="White"
  59. Text="&#xe8e7;" />
  60. </Grid>
  61. <ControlTemplate.Triggers>
  62. <Trigger Property="IsMouseOver" Value="True">
  63. <Setter TargetName="gr" Property="Background" Value="#22009DFF" />
  64. </Trigger>
  65. </ControlTemplate.Triggers>
  66. </ControlTemplate>
  67. </Setter.Value>
  68. </Setter>
  69. </Style>
  70. <Style x:Key="btn" TargetType="Button">
  71. <Setter Property="Background" Value="#064d87" />
  72. <Setter Property="Foreground" Value="White" />
  73. <Setter Property="Template">
  74. <Setter.Value>
  75. <ControlTemplate TargetType="Button">
  76. <Border
  77. Name="gr"
  78. Background="{TemplateBinding Background}"
  79. CornerRadius="5"
  80. Opacity="0.8">
  81. <ContentPresenter
  82. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  83. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  84. Content="{TemplateBinding Content}" />
  85. </Border>
  86. <ControlTemplate.Triggers>
  87. <Trigger Property="IsMouseOver" Value="True">
  88. <Setter TargetName="gr" Property="Opacity" Value="1" />
  89. </Trigger>
  90. </ControlTemplate.Triggers>
  91. </ControlTemplate>
  92. </Setter.Value>
  93. </Setter>
  94. </Style>
  95. </ResourceDictionary>
  96. </ResourceDictionary.MergedDictionaries>
  97. </ResourceDictionary>
  98. </Window.Resources>
  99. <Border
  100. Name="br"
  101. Background="Transparent"
  102. BorderBrush="#064d87"
  103. BorderThickness="2">
  104. <Grid Background="#061c43">
  105. <Grid.RowDefinitions>
  106. <RowDefinition Height="40" />
  107. <RowDefinition />
  108. </Grid.RowDefinitions>
  109. <Border BorderBrush="#064d87" BorderThickness="0,0,0,2">
  110. <Border.Background>
  111. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  112. <GradientStop Color="#064d87" />
  113. <GradientStop Offset="1" Color="#99064d87" />
  114. </LinearGradientBrush>
  115. </Border.Background>
  116. <TextBlock
  117. Margin="10,0,0,0"
  118. Foreground="White"
  119. Text="新建配方" />
  120. </Border>
  121. <Button
  122. Width="40"
  123. HorizontalAlignment="Right"
  124. HorizontalContentAlignment="Center"
  125. VerticalContentAlignment="Center"
  126. Click="btClose_Click"
  127. Style="{StaticResource closeBtn}" />
  128. <Grid Grid.Row="1">
  129. <Grid.RowDefinitions>
  130. <RowDefinition Height="80" />
  131. <RowDefinition Height="30" />
  132. <RowDefinition />
  133. <RowDefinition Height="40" />
  134. </Grid.RowDefinitions>
  135. <Grid Grid.Row="0" Margin="5,0">
  136. <Grid.ColumnDefinitions>
  137. <ColumnDefinition Width="auto" />
  138. <ColumnDefinition />
  139. <ColumnDefinition Width="118" />
  140. </Grid.ColumnDefinitions>
  141. <Grid.RowDefinitions>
  142. <RowDefinition />
  143. <RowDefinition />
  144. </Grid.RowDefinitions>
  145. <TextBlock
  146. Background="Transparent"
  147. FontSize="20"
  148. Foreground="#FF2AB2E7"
  149. Text="请输入配方名称:" />
  150. <TextBox
  151. Grid.Column="1"
  152. Grid.ColumnSpan="2"
  153. Height="30"
  154. Margin="0,0,7,0"
  155. BorderThickness="2"
  156. CaretBrush="DeepSkyBlue"
  157. FontSize="16"
  158. Text="{Binding RecipeName}" />
  159. <TextBlock
  160. Grid.Row="1"
  161. Grid.Column="0"
  162. Grid.ColumnSpan="2"
  163. HorizontalAlignment="Left"
  164. Background="Transparent"
  165. FontSize="16"
  166. Foreground="Red"
  167. Text="{Binding ErrorInfo}" />
  168. <Button
  169. Grid.Row="1"
  170. Grid.Column="2"
  171. Width="118"
  172. Height="30"
  173. Command="{Binding AddCommand}"
  174. Content="添加原料"
  175. Cursor="Hand"
  176. Style="{StaticResource btn}" />
  177. </Grid>
  178. <!--#region 表格标题栏设置-->
  179. <Grid
  180. Grid.Row="1"
  181. Margin="5,0"
  182. Background="#ff0C255F">
  183. <Grid.ColumnDefinitions>
  184. <ColumnDefinition />
  185. <ColumnDefinition Width="0.7*" />
  186. <ColumnDefinition Width="0.7*" />
  187. <ColumnDefinition Width="0.7*" />
  188. </Grid.ColumnDefinitions>
  189. <TextBlock
  190. Grid.Column="0"
  191. Grid.ColumnSpan="2"
  192. Style="{StaticResource TitleTextblockStyle}"
  193. Text="原料名称" />
  194. <Border
  195. Grid.ColumnSpan="2"
  196. BorderBrush="{StaticResource bordColor}"
  197. BorderThickness="1,0,1,0"
  198. Cursor="SizeWE" />
  199. <!--<Grid Grid.Column="1">
  200. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="桶号" />
  201. <Border
  202. BorderBrush="{StaticResource bordColor}"
  203. BorderThickness="1,0,1,0"
  204. Cursor="SizeWE" />
  205. </Grid>-->
  206. <TextBlock
  207. Grid.Column="2"
  208. Style="{StaticResource TitleTextblockStyle}"
  209. Text="重量" />
  210. <Grid Grid.Column="3">
  211. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="删除" />
  212. <Border
  213. BorderBrush="{StaticResource bordColor}"
  214. BorderThickness="1,0,1,0"
  215. Cursor="SizeWE" />
  216. </Grid>
  217. <Border
  218. Grid.ColumnSpan="10"
  219. BorderBrush="{StaticResource bordColor}"
  220. BorderThickness="0,1,0,1" />
  221. </Grid>
  222. <!--#endregion-->
  223. <ScrollViewer
  224. Grid.Row="2"
  225. Margin="5,0"
  226. HorizontalScrollBarVisibility="Hidden"
  227. VerticalScrollBarVisibility="Hidden">
  228. <ItemsControl ItemsSource="{Binding RawMaterials}">
  229. <ItemsControl.ItemTemplate>
  230. <DataTemplate>
  231. <RadioButton GroupName="all">
  232. <RadioButton.Template>
  233. <ControlTemplate TargetType="RadioButton">
  234. <Grid Name="gr" Height="35">
  235. <Grid.ColumnDefinitions>
  236. <ColumnDefinition />
  237. <ColumnDefinition Width="0.7*" />
  238. <ColumnDefinition Width="0.7*" />
  239. <ColumnDefinition Width="0.7*" />
  240. </Grid.ColumnDefinitions>
  241. <!--<TextBox
  242. Grid.Column="0"
  243. Grid.ColumnSpan="2"
  244. Height="{Binding ElementName=gr, Path=ActualHeight}"
  245. VerticalAlignment="Center"
  246. BorderBrush="#FF074B92"
  247. BorderThickness="1"
  248. FontFamily="楷体"
  249. FontSize="20"
  250. Foreground="#FF2AB2E7"
  251. Style="{StaticResource InputTextboxStyle}"
  252. Text="{Binding RawMaterialName}" />-->
  253. <TextBox
  254. Name="cb"
  255. Grid.Column="0"
  256. Grid.ColumnSpan="2"
  257. Height="{Binding ElementName=gr, Path=ActualHeight}"
  258. VerticalAlignment="Center"
  259. CaretBrush="DeepSkyBlue"
  260. FontSize="20"
  261. Foreground="#FF2AB2E7"
  262. Text="{Binding RawMaterialName}" />
  263. <!--<TextBox
  264. Grid.Column="1"
  265. Height="{Binding ElementName=gr, Path=ActualHeight}"
  266. VerticalAlignment="Center"
  267. FontSize="20"
  268. Foreground="#FF2AB2E7"
  269. Text="{Binding Loc}" />-->
  270. <TextBox
  271. Name="tb"
  272. Grid.Column="2"
  273. Height="{Binding ElementName=gr, Path=ActualHeight}"
  274. VerticalAlignment="Center"
  275. CaretBrush="DeepSkyBlue"
  276. FontSize="20"
  277. Foreground="#FF2AB2E7"
  278. Text="{Binding RawMaterialWeight}" />
  279. <TextBlock
  280. Grid.Column="2"
  281. Margin="0,0,8,4"
  282. HorizontalAlignment="Right"
  283. VerticalAlignment="Center"
  284. FontSize="20"
  285. Foreground="#FF2AB2E7"
  286. Text="g" />
  287. <Button
  288. Grid.Column="3"
  289. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  290. CommandParameter="{Binding RawMaterialId}"
  291. Content="删除"
  292. FontSize="16"
  293. Style="{StaticResource ControlButtonStyle}" />
  294. </Grid>
  295. </ControlTemplate>
  296. </RadioButton.Template>
  297. </RadioButton>
  298. </DataTemplate>
  299. </ItemsControl.ItemTemplate>
  300. </ItemsControl>
  301. </ScrollViewer>
  302. <Border
  303. Grid.Row="3"
  304. BorderBrush="#064d87"
  305. BorderThickness="0,1,0,0">
  306. <StackPanel
  307. Margin="0,0,10,0"
  308. HorizontalAlignment="Right"
  309. Orientation="Horizontal">
  310. <Button
  311. Width="80"
  312. Height="30"
  313. Command="{Binding SaveCommand}"
  314. Content="确认"
  315. Style="{StaticResource btn}" />
  316. <Button
  317. Name="btClose"
  318. Width="80"
  319. Height="30"
  320. Margin="7,0,0,0"
  321. Click="btClose_Click"
  322. Content="取消"
  323. Style="{StaticResource btn}" />
  324. </StackPanel>
  325. </Border>
  326. </Grid>
  327. </Grid>
  328. </Border>
  329. </Window>