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

378 rivejä
17 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.FoodStationTest.View.BomOfMaterialView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:con="clr-namespace:BPASmartClient.FoodStationTest.Converter"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  9. xmlns:vm="clr-namespace:BPASmartClient.FoodStationTest.ViewModel"
  10. d:DesignHeight="1080"
  11. d:DesignWidth="1920"
  12. mc:Ignorable="d">
  13. <UserControl.DataContext>
  14. <vm:BomOfMaterialViewModel />
  15. </UserControl.DataContext>
  16. <UserControl.Resources>
  17. <ResourceDictionary>
  18. <ResourceDictionary.MergedDictionaries>
  19. <ResourceDictionary Source="/BPASmartClient.FoodStationTest;component/Resource/MyStyle.xaml" />
  20. </ResourceDictionary.MergedDictionaries>
  21. </ResourceDictionary>
  22. </UserControl.Resources>
  23. <!--<UserControl.Resources>
  24. <SolidColorBrush x:Key="tabColor" Color="#FF2AB2E7" />
  25. -->
  26. <!--<SolidColorBrush x:Key="bordColor" Color="#33ffffff" />-->
  27. <!--
  28. <SolidColorBrush x:Key="bordColor" Color="#332AB2E7" />
  29. <con:DataTableRedundantConverter x:Key="tabConvert" />
  30. <Style x:Key="RowRadioButtonStyle" TargetType="{x:Type RadioButton}">
  31. <Setter Property="Template">
  32. <Setter.Value>
  33. <ControlTemplate TargetType="{x:Type RadioButton}">
  34. <Border
  35. x:Name="NvaBor"
  36. Background="Transparent"
  37. BorderBrush="#FF2AB2E7"
  38. BorderThickness="0">
  39. <ContentControl
  40. Margin="10,4"
  41. HorizontalAlignment="Center"
  42. VerticalAlignment="Center"
  43. HorizontalContentAlignment="Center"
  44. VerticalContentAlignment="Center"
  45. Content="{TemplateBinding Content}"
  46. FontSize="16" />
  47. </Border>
  48. <ControlTemplate.Triggers>
  49. <Trigger Property="IsChecked" Value="True">
  50. <Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" />
  51. <Setter TargetName="NvaBor" Property="BorderThickness" Value="0" />
  52. </Trigger>
  53. <MultiTrigger>
  54. <MultiTrigger.Conditions>
  55. <Condition Property="IsChecked" Value="false" />
  56. <Condition Property="IsMouseOver" Value="True" />
  57. </MultiTrigger.Conditions>
  58. <MultiTrigger.Setters>
  59. <Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" />
  60. </MultiTrigger.Setters>
  61. </MultiTrigger>
  62. </ControlTemplate.Triggers>
  63. </ControlTemplate>
  64. </Setter.Value>
  65. </Setter>
  66. </Style>
  67. <Style x:Key="InputTextboxStyle" TargetType="TextBox">
  68. <Setter Property="Margin" Value="5,0,0,0" />
  69. <Setter Property="BorderThickness" Value="0" />
  70. <Setter Property="HorizontalAlignment" Value="Left" />
  71. <Setter Property="Width" Value="150" />
  72. <Setter Property="Height" Value="40" />
  73. <Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" />
  74. <Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" />
  75. <Setter Property="VerticalContentAlignment" Value="Center" />
  76. <Setter Property="FontSize" Value="14" />
  77. <Setter Property="Background" Value="Transparent" />
  78. <Setter Property="VerticalAlignment" Value="Center" />
  79. </Style>
  80. <Style x:Key="ControlButtonStyle" TargetType="Button">
  81. <Setter Property="Margin" Value="0" />
  82. <Setter Property="FontSize" Value="18" />
  83. <Setter Property="Foreground" Value="#FFF53F62" />
  84. <Setter Property="FontWeight" Value="SemiBold" />
  85. <Setter Property="FontFamily" Value="楷体" />
  86. <Setter Property="VerticalContentAlignment" Value="Center" />
  87. <Setter Property="Template">
  88. <Setter.Value>
  89. <ControlTemplate TargetType="Button">
  90. <Border
  91. Name="TitleBarBr"
  92. BorderBrush="#00c2f4"
  93. BorderThickness="0"
  94. CornerRadius="0"
  95. Opacity="0.8">
  96. <ContentPresenter
  97. Margin="{TemplateBinding Margin}"
  98. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  99. VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  100. <Border.Background>
  101. <ImageBrush
  102. ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框1.1.png"
  103. Opacity="0.8"
  104. Stretch="Fill" />
  105. </Border.Background>
  106. </Border>
  107. <ControlTemplate.Triggers>
  108. <Trigger Property="IsMouseOver" Value="true">
  109. <Setter TargetName="TitleBarBr" Property="Opacity" Value="1" />
  110. </Trigger>
  111. </ControlTemplate.Triggers>
  112. </ControlTemplate>
  113. </Setter.Value>
  114. </Setter>
  115. </Style>
  116. <Style x:Key="TitleTextblockStyle" TargetType="TextBlock">
  117. <Setter Property="FontSize" Value="16" />
  118. <Setter Property="HorizontalAlignment" Value="Center" />
  119. <Setter Property="VerticalAlignment" Value="Center" />
  120. <Setter Property="Foreground" Value="{StaticResource tabColor}" />
  121. <Setter Property="FontFamily" Value="楷体" />
  122. <Setter Property="FontWeight" Value="SemiBold" />
  123. </Style>
  124. </UserControl.Resources>-->
  125. <Grid Margin="10">
  126. <Grid.RowDefinitions>
  127. <RowDefinition Height="60" />
  128. <RowDefinition Height="50" />
  129. <RowDefinition />
  130. </Grid.RowDefinitions>
  131. <!--#region 表格标题栏设置-->
  132. <Grid>
  133. <StackPanel
  134. Margin="0,0,10,0"
  135. HorizontalAlignment="Right"
  136. Orientation="Horizontal">
  137. <Button
  138. Width="200"
  139. Height="50"
  140. Margin="5"
  141. Command="{Binding GetBomMaterialData}"
  142. Content="拉取本地数据"
  143. FontSize="28"
  144. Foreground="DeepSkyBlue"
  145. Style="{StaticResource ImageButtonStyle}" />
  146. <Button
  147. Width="200"
  148. Height="50"
  149. Margin="5"
  150. Command="{Binding DeleteAllMaterial}"
  151. Content="删除所有数据"
  152. FontSize="28"
  153. Foreground="DeepSkyBlue"
  154. Style="{StaticResource ImageButtonStyle}" />
  155. <Button
  156. Width="200"
  157. Height="50"
  158. Margin="5"
  159. Command="{Binding AddMaterial}"
  160. Content="新增数据"
  161. FontSize="28"
  162. Foreground="DeepSkyBlue"
  163. Style="{StaticResource ImageButtonStyle}" />
  164. <Button
  165. Width="200"
  166. Height="50"
  167. Margin="5"
  168. Command="{Binding SaveMaterials}"
  169. Content="保存参数"
  170. FontSize="28"
  171. Foreground="DeepSkyBlue"
  172. Style="{StaticResource ImageButtonStyle}" />
  173. </StackPanel>
  174. </Grid>
  175. <Grid
  176. Grid.Row="1"
  177. Margin="0,10,17,0"
  178. Background="#ff0C255F">
  179. <Grid.ColumnDefinitions>
  180. <ColumnDefinition />
  181. <ColumnDefinition />
  182. <ColumnDefinition />
  183. <ColumnDefinition />
  184. </Grid.ColumnDefinitions>
  185. <TextBlock
  186. Grid.Column="0"
  187. FontSize="24"
  188. Style="{StaticResource TitleTextblockStyle}"
  189. Text="序号" />
  190. <TextBlock
  191. Grid.Column="1"
  192. FontSize="24"
  193. Style="{StaticResource TitleTextblockStyle}"
  194. Text="原料编号" />
  195. <TextBlock
  196. Grid.Column="2"
  197. FontSize="24"
  198. Style="{StaticResource TitleTextblockStyle}"
  199. Text="原料名称" />
  200. <TextBlock
  201. Grid.Column="3"
  202. FontSize="24"
  203. Style="{StaticResource TitleTextblockStyle}"
  204. Text="操作" />
  205. <Border
  206. Grid.Column="0"
  207. Grid.ColumnSpan="4"
  208. BorderBrush="{StaticResource bordColor}"
  209. BorderThickness="1,1,1,1" />
  210. <Border
  211. Grid.Column="1"
  212. BorderBrush="{StaticResource bordColor}"
  213. BorderThickness="1,0,1,0" />
  214. <Border
  215. Grid.Column="3"
  216. BorderBrush="{StaticResource bordColor}"
  217. BorderThickness="1,0,1,0" />
  218. <!--<Grid Grid.Column="0">
  219. <TextBlock
  220. HorizontalAlignment="Center"
  221. VerticalAlignment="Center"
  222. FontSize="24"
  223. Foreground="Aqua"
  224. Text="序号" />
  225. -->
  226. <!--<Border BorderThickness="1,1,1,1" Cursor="SizeWE"
  227. BorderBrush="{StaticResource bordColor}" />-->
  228. <!--
  229. </Grid>
  230. <TextBlock
  231. Grid.Column="1"
  232. HorizontalAlignment="Center"
  233. VerticalAlignment="Center"
  234. FontSize="24"
  235. Foreground="Aqua"
  236. Text="原料编号" />
  237. <TextBlock
  238. Grid.Column="2"
  239. HorizontalAlignment="Center"
  240. VerticalAlignment="Center"
  241. FontSize="24"
  242. Foreground="Aqua"
  243. Text="原料名称" />
  244. <TextBlock
  245. Grid.Column="3"
  246. HorizontalAlignment="Center"
  247. VerticalAlignment="Center"
  248. FontSize="24"
  249. Foreground="Aqua"
  250. Text="操作" />-->
  251. </Grid>
  252. <Grid Grid.Row="2">
  253. <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Visible">
  254. <ItemsControl Foreground="DeepSkyBlue" ItemsSource="{Binding RawMaterialInfo}">
  255. <ItemsControl.ItemTemplate>
  256. <DataTemplate>
  257. <Grid Name="gr">
  258. <Grid.ColumnDefinitions>
  259. <ColumnDefinition />
  260. <ColumnDefinition />
  261. <ColumnDefinition />
  262. <ColumnDefinition />
  263. </Grid.ColumnDefinitions>
  264. <TextBlock
  265. Grid.Column="0"
  266. HorizontalAlignment="Center"
  267. VerticalAlignment="Center"
  268. FontSize="16"
  269. Text="{Binding Count}" />
  270. <TextBox
  271. Grid.Column="1"
  272. Style="{StaticResource InputTextboxStyle}"
  273. Text="{Binding MaterialCode}" />
  274. <TextBox
  275. Grid.Column="2"
  276. Style="{StaticResource InputTextboxStyle}"
  277. Text="{Binding MaterialName}" />
  278. <Button
  279. Grid.Column="3"
  280. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  281. CommandParameter="{Binding RawMaterialLocation}"
  282. Content="删除"
  283. FontSize="16"
  284. Style="{StaticResource ControlButtonStyle}" />
  285. <Border
  286. Grid.Column="0"
  287. Grid.ColumnSpan="4"
  288. BorderBrush="{StaticResource bordColor}"
  289. BorderThickness="1,0,1,1" />
  290. <Border
  291. Grid.Column="1"
  292. BorderBrush="{StaticResource bordColor}"
  293. BorderThickness="1,0,1,0" />
  294. <Border
  295. Grid.Column="3"
  296. BorderBrush="{StaticResource bordColor}"
  297. BorderThickness="1,0,1,0" />
  298. <!--<Grid Grid.Column="0" Margin="5">
  299. <TextBlock
  300. HorizontalAlignment="Center"
  301. VerticalAlignment="Center"
  302. FontSize="16"
  303. Text="{Binding Count}" />
  304. </Grid>
  305. <Grid Grid.Column="1" Margin="5">
  306. <TextBox
  307. Width="50"
  308. HorizontalAlignment="Center"
  309. VerticalAlignment="Center"
  310. FontSize="16"
  311. Text="{Binding MaterialCode}" />
  312. </Grid>
  313. <Grid Grid.Column="2" Margin="5">
  314. <TextBox
  315. Width="200"
  316. HorizontalAlignment="Center"
  317. VerticalAlignment="Center"
  318. FontSize="16"
  319. Text="{Binding MaterialName}" />
  320. </Grid>
  321. <Grid Grid.Column="3" Margin="5">
  322. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  323. <pry:IcoButton
  324. Margin="3,4,4,0"
  325. HorizontalAlignment="Center"
  326. VerticalAlignment="Center"
  327. Background="#11F53F62"
  328. BorderThickness="0"
  329. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  330. CommandParameter="{Binding Count}"
  331. Content="删除"
  332. EnterBackground="#22F53F62"
  333. Foreground="#FFF53F62"
  334. IcoText="&#xe68e;"
  335. Style="{StaticResource IcoButtonStyle}" />
  336. </StackPanel>
  337. </Grid>-->
  338. </Grid>
  339. <DataTemplate.Triggers>
  340. <Trigger Property="IsMouseOver" Value="true">
  341. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  342. </Trigger>
  343. </DataTemplate.Triggers>
  344. </DataTemplate>
  345. </ItemsControl.ItemTemplate>
  346. </ItemsControl>
  347. </ScrollViewer>
  348. </Grid>
  349. </Grid>
  350. </UserControl>