终端一体化运控平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

NewMaterialView.xaml 12 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <Window
  2. x:Class="BPASmartClient.Academy.View.NewMaterialView"
  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="NewMateritalView"
  10. Width="600"
  11. Height="350"
  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:NewMaterialViewModel />
  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. <SolidColorBrush x:Key="tabColor" Color="#FF2AB2E7" />
  28. <!--<SolidColorBrush x:Key="bordColor" Color="#33ffffff" />-->
  29. <SolidColorBrush x:Key="bordColor" Color="#332AB2E7" />
  30. <Style x:Key="ControlButtonStyle" TargetType="Button">
  31. <Setter Property="Margin" Value="0" />
  32. <Setter Property="FontSize" Value="18" />
  33. <Setter Property="Foreground" Value="#FFF53F62" />
  34. <Setter Property="FontWeight" Value="SemiBold" />
  35. <Setter Property="FontFamily" Value="楷体" />
  36. <Setter Property="VerticalContentAlignment" Value="Center" />
  37. <Setter Property="Template">
  38. <Setter.Value>
  39. <ControlTemplate TargetType="Button">
  40. <Border
  41. Name="TitleBarBr"
  42. BorderBrush="#00c2f4"
  43. BorderThickness="0"
  44. CornerRadius="0"
  45. Opacity="0.8">
  46. <ContentPresenter
  47. Margin="{TemplateBinding Margin}"
  48. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  49. VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  50. <Border.Background>
  51. <ImageBrush
  52. ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框1.1.png"
  53. Opacity="0.8"
  54. Stretch="Fill" />
  55. </Border.Background>
  56. </Border>
  57. <ControlTemplate.Triggers>
  58. <Trigger Property="IsMouseOver" Value="true">
  59. <Setter TargetName="TitleBarBr" Property="Opacity" Value="1" />
  60. </Trigger>
  61. </ControlTemplate.Triggers>
  62. </ControlTemplate>
  63. </Setter.Value>
  64. </Setter>
  65. </Style>
  66. <Style x:Key="TitleTextblockStyle" TargetType="TextBlock">
  67. <Setter Property="FontSize" Value="16" />
  68. <Setter Property="HorizontalAlignment" Value="Center" />
  69. <Setter Property="VerticalAlignment" Value="Center" />
  70. <Setter Property="Foreground" Value="{StaticResource tabColor}" />
  71. <Setter Property="FontFamily" Value="楷体" />
  72. <Setter Property="FontWeight" Value="SemiBold" />
  73. </Style>
  74. <!--#region ListBox样式-->
  75. <Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
  76. <Setter Property="OverridesDefaultStyle" Value="True" />
  77. <Setter Property="SnapsToDevicePixels" Value="True" />
  78. <Setter Property="BorderBrush" Value="{x:Null}" />
  79. <Setter Property="Foreground" Value="White" />
  80. <Setter Property="FontSize" Value="20" />
  81. <Setter Property="HorizontalContentAlignment" Value="Center" />
  82. <Setter Property="VerticalContentAlignment" Value="Center" />
  83. <Setter Property="Template">
  84. <Setter.Value>
  85. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  86. <Border x:Name="border" CornerRadius="8">
  87. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  88. </Border>
  89. </ControlTemplate>
  90. </Setter.Value>
  91. </Setter>
  92. </Style>
  93. <!--#endregion-->
  94. </ResourceDictionary>
  95. </ResourceDictionary.MergedDictionaries>
  96. </ResourceDictionary>
  97. </Window.Resources>
  98. <Border Name="br" BorderThickness="1">
  99. <Border.Background>
  100. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/容器边框.png" />
  101. </Border.Background>
  102. <Grid>
  103. <Grid.RowDefinitions>
  104. <RowDefinition Height="55" />
  105. <RowDefinition Height="20" />
  106. <RowDefinition Height="40" />
  107. <RowDefinition />
  108. </Grid.RowDefinitions>
  109. <TextBlock
  110. HorizontalAlignment="Center"
  111. VerticalAlignment="Center"
  112. FontSize="25"
  113. Foreground="#FF2AB2E7"
  114. Text="本地原料创建" />
  115. <Grid Grid.Row="2" Margin="10,0">
  116. <Grid.ColumnDefinitions>
  117. <ColumnDefinition />
  118. <ColumnDefinition Width="150" />
  119. </Grid.ColumnDefinitions>
  120. <Grid>
  121. <Grid.ColumnDefinitions>
  122. <ColumnDefinition Width="auto" />
  123. <ColumnDefinition />
  124. </Grid.ColumnDefinitions>
  125. <TextBlock
  126. HorizontalAlignment="Left"
  127. Background="Transparent"
  128. FontSize="20"
  129. Foreground="#FF2AB2E7"
  130. Text="请输入原料名称:" />
  131. <TextBox
  132. Grid.Column="1"
  133. Height="30"
  134. FontSize="16"
  135. Text="{Binding MaterialName}" />
  136. </Grid>
  137. <StackPanel Grid.Column="1" Orientation="Horizontal">
  138. <Button
  139. Width="80"
  140. Height="30"
  141. Margin="5,0"
  142. Command="{Binding SaveCommand}"
  143. Content="添加"
  144. Cursor="Hand" />
  145. <Button
  146. Name="btClose"
  147. Width="70"
  148. Height="30"
  149. Click="btClose_Click"
  150. Content="取消" />
  151. </StackPanel>
  152. </Grid>
  153. <TextBlock
  154. Grid.Row="1"
  155. HorizontalAlignment="Center"
  156. VerticalAlignment="Center"
  157. Background="Transparent"
  158. FontSize="16"
  159. Foreground="Red"
  160. Text="{Binding ErrorInfo}" />
  161. <Grid Grid.Row="4" Margin="10,0">
  162. <Grid.RowDefinitions>
  163. <RowDefinition Height="40" />
  164. <RowDefinition Height="*" />
  165. </Grid.RowDefinitions>
  166. <Grid Margin="0,10,0,0" Background="#ff0C255F">
  167. <Grid.ColumnDefinitions>
  168. <ColumnDefinition />
  169. <ColumnDefinition Width="150" />
  170. </Grid.ColumnDefinitions>
  171. <TextBlock
  172. Grid.Column="0"
  173. Style="{StaticResource TitleTextblockStyle}"
  174. Text="原料名称" />
  175. <Grid Grid.Column="1">
  176. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="功能操作" />
  177. <Border
  178. BorderBrush="{StaticResource bordColor}"
  179. BorderThickness="1,0,1,0"
  180. Cursor="SizeWE" />
  181. </Grid>
  182. <Border
  183. Grid.ColumnSpan="2"
  184. BorderBrush="{StaticResource bordColor}"
  185. BorderThickness="1,0,1,0" />
  186. </Grid>
  187. <ScrollViewer
  188. Grid.Row="1"
  189. BorderBrush="#FF2AB2E7"
  190. BorderThickness="1"
  191. HorizontalScrollBarVisibility="Hidden"
  192. VerticalScrollBarVisibility="Hidden">
  193. <ItemsControl ItemsSource="{Binding Materials}">
  194. <ItemsControl.ItemTemplate>
  195. <DataTemplate>
  196. <Grid Name="gr" Height="30">
  197. <Grid.ColumnDefinitions>
  198. <ColumnDefinition />
  199. <ColumnDefinition Width="150" />
  200. </Grid.ColumnDefinitions>
  201. <TextBlock
  202. Grid.Column="0"
  203. Margin="10,0,0,0"
  204. VerticalAlignment="Center"
  205. Foreground="{StaticResource TitleBorderColor}"
  206. Text="{Binding RawMaterialName}" />
  207. <Grid Grid.Column="1">
  208. <Button
  209. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  210. CommandParameter="{Binding RawMaterialId}"
  211. Content="删除"
  212. FontSize="16"
  213. Style="{StaticResource ControlButtonStyle}" />
  214. <Border BorderBrush="{StaticResource bordColor}" BorderThickness="1,0,1,0" />
  215. </Grid>
  216. <Border
  217. Grid.ColumnSpan="2"
  218. BorderBrush="{StaticResource bordColor}"
  219. BorderThickness="1,0,1,1" />
  220. </Grid>
  221. <DataTemplate.Triggers>
  222. <Trigger Property="IsMouseOver" Value="true">
  223. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  224. </Trigger>
  225. </DataTemplate.Triggers>
  226. </DataTemplate>
  227. </ItemsControl.ItemTemplate>
  228. </ItemsControl>
  229. </ScrollViewer>
  230. <!--</Border>-->
  231. </Grid>
  232. </Grid>
  233. </Border>
  234. </Window>