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

176 行
7.8 KiB

  1. <Window
  2. x:Class="BPASmartClient.FoodStationTest.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.FoodStationTest.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:vm="clr-namespace:BPASmartClient.FoodStationTest.ViewModel"
  9. Title="NewMateritalView"
  10. Width="600"
  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: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. <!--#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 Height="*" />
  59. <RowDefinition Height="40" />
  60. <RowDefinition Height="5" />
  61. <RowDefinition Height="5*" />
  62. </Grid.RowDefinitions>
  63. <StackPanel
  64. Grid.Row="1"
  65. HorizontalAlignment="Center"
  66. VerticalAlignment="Center"
  67. Orientation="Horizontal">
  68. <TextBlock
  69. Margin="10,0,0,0"
  70. Background="Transparent"
  71. FontSize="20"
  72. Foreground="#FF2AB2E7"
  73. Text="请输入原料名称:" />
  74. <TextBox
  75. Grid.Column="1"
  76. Width="200"
  77. Height="30"
  78. Margin="10"
  79. FontSize="16"
  80. Text="{Binding MaterialName}" />
  81. <Button
  82. Width="80"
  83. Height="30"
  84. Margin="10"
  85. Command="{Binding SaveCommand}"
  86. Content="保存"
  87. Cursor="Hand" />
  88. <Button
  89. Name="btClose"
  90. Width="80"
  91. Height="30"
  92. Margin="10"
  93. Click="btClose_Click"
  94. Content="取消" />
  95. </StackPanel>
  96. <TextBlock
  97. Grid.Row="2"
  98. Margin="0,0,5,0"
  99. HorizontalAlignment="Center"
  100. Background="Transparent"
  101. FontSize="16"
  102. Foreground="Red"
  103. Text="{Binding ErrorInfo}" />
  104. <Grid Grid.Row="4">
  105. <Grid.RowDefinitions>
  106. <RowDefinition Height="40" />
  107. <RowDefinition Height="*" />
  108. </Grid.RowDefinitions>
  109. <TextBlock
  110. HorizontalAlignment="Center"
  111. FontSize="25"
  112. Foreground="#FF2AB2E7"
  113. Text="本地原料" />
  114. <Border
  115. Grid.Row="1"
  116. Margin="100,10"
  117. BorderBrush="#FF2AB2E7"
  118. BorderThickness="1">
  119. <ScrollViewer
  120. Grid.Row="1"
  121. BorderBrush="#FF2AB2E7"
  122. BorderThickness="1">
  123. <ItemsControl Margin="10" ItemsSource="{Binding Materials}">
  124. <ItemsControl.ItemTemplate>
  125. <DataTemplate>
  126. <RadioButton GroupName="all">
  127. <RadioButton.Template>
  128. <ControlTemplate TargetType="RadioButton">
  129. <Grid Name="gr" Height="40">
  130. <Grid.ColumnDefinitions>
  131. <ColumnDefinition Width="2*" />
  132. <ColumnDefinition Width="*" />
  133. </Grid.ColumnDefinitions>
  134. <TextBlock
  135. Name="tb"
  136. Grid.Column="0"
  137. Width="150"
  138. Height="29"
  139. Margin="3,1"
  140. HorizontalAlignment="Center"
  141. VerticalAlignment="Center"
  142. FontSize="20"
  143. Text="{Binding RawMaterialName}" />
  144. <Button
  145. Grid.Column="1"
  146. Margin="10,0,10,0"
  147. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  148. CommandParameter="{Binding RawMaterialId}"
  149. Content="删除" />
  150. </Grid>
  151. </ControlTemplate>
  152. </RadioButton.Template>
  153. </RadioButton>
  154. </DataTemplate>
  155. </ItemsControl.ItemTemplate>
  156. </ItemsControl>
  157. </ScrollViewer>
  158. </Border>
  159. </Grid>
  160. </Grid>
  161. </Border>
  162. </Window>