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

222 lines
11 KiB

  1. <Window
  2. x:Class="BPASmartClient.JXJFoodSmallStation.View.SelectRecipesView"
  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.JXJFoodSmallStation.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
  9. Title="SelectRecipesView"
  10. Width="1000"
  11. Height="620"
  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:SelectRecipesViewModel />
  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.MergedDictionaries>
  27. <!--修改了勾选的大小-->
  28. <Style x:Key="CheckBoxLarge" TargetType="{x:Type CheckBox}">
  29. <Setter Property="Foreground" Value="{DynamicResource foreground}" />
  30. <Setter Property="VerticalContentAlignment" Value="Center" />
  31. <Setter Property="FocusVisualStyle">
  32. <Setter.Value>
  33. <Style>
  34. <Setter Property="Control.Template">
  35. <Setter.Value>
  36. <ControlTemplate>
  37. <Rectangle
  38. Margin="1"
  39. SnapsToDevicePixels="True"
  40. Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
  41. StrokeDashArray="1 2"
  42. StrokeThickness="1" />
  43. </ControlTemplate>
  44. </Setter.Value>
  45. </Setter>
  46. </Style>
  47. </Setter.Value>
  48. </Setter>
  49. <Setter Property="Template">
  50. <Setter.Value>
  51. <ControlTemplate TargetType="{x:Type CheckBox}">
  52. <StackPanel
  53. Background="Transparent"
  54. Orientation="Horizontal"
  55. SnapsToDevicePixels="True">
  56. <Grid>
  57. <Image
  58. Width="24"
  59. Height="28"
  60. Source="/BPASmartClient.CustomResource;component/Image/Cb_HalfChecked.png" />
  61. <Image
  62. x:Name="image1"
  63. Width="24"
  64. Height="28"
  65. Source="/BPASmartClient.CustomResource;component/Image/Cb_HalfChecked.png" />
  66. </Grid>
  67. <ContentPresenter
  68. Margin="{TemplateBinding Padding}"
  69. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  70. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  71. Content="{TemplateBinding Content}"
  72. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  73. RecognizesAccessKey="True"
  74. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  75. </StackPanel>
  76. <ControlTemplate.Triggers>
  77. <Trigger Property="HasContent" Value="True">
  78. <Setter Property="FocusVisualStyle">
  79. <Setter.Value>
  80. <Style>
  81. <Setter Property="Control.Template">
  82. <Setter.Value>
  83. <ControlTemplate>
  84. <Rectangle
  85. Margin="14,0,0,0"
  86. SnapsToDevicePixels="True"
  87. Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
  88. StrokeDashArray="1 2"
  89. StrokeThickness="1" />
  90. </ControlTemplate>
  91. </Setter.Value>
  92. </Setter>
  93. </Style>
  94. </Setter.Value>
  95. </Setter>
  96. <Setter Property="Padding" Value="4,0,0,0" />
  97. </Trigger>
  98. <Trigger Property="IsEnabled" Value="False">
  99. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  100. </Trigger>
  101. <Trigger Property="IsChecked" Value="true">
  102. <Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/Cb_Checked.png" />
  103. </Trigger>
  104. <Trigger Property="IsChecked" Value="{x:Null}">
  105. <Setter TargetName="image1" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/Cb_HalfChecked.png" />
  106. </Trigger>
  107. </ControlTemplate.Triggers>
  108. </ControlTemplate>
  109. </Setter.Value>
  110. </Setter>
  111. </Style>
  112. </ResourceDictionary>
  113. </Window.Resources>
  114. <Border
  115. Name="br"
  116. BorderBrush="#0CADF5"
  117. BorderThickness="2">
  118. <Border.Background>
  119. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" />
  120. </Border.Background>
  121. <Grid>
  122. <Grid.RowDefinitions>
  123. <RowDefinition Height="40" />
  124. <RowDefinition Height="40" />
  125. <RowDefinition Height="1*" />
  126. </Grid.RowDefinitions>
  127. <TextBlock
  128. HorizontalAlignment="Center"
  129. FontSize="35"
  130. Text="配方筛选界面" />
  131. <StackPanel
  132. Grid.Row="1"
  133. Margin="10,0"
  134. HorizontalAlignment="Right"
  135. Orientation="Horizontal">
  136. <Button
  137. Width="100"
  138. Margin="20,0"
  139. Command="{Binding AllSelectCommand}"
  140. Content="全选" />
  141. <Button
  142. Width="100"
  143. Margin="20,0"
  144. Command="{Binding AllCancelCommand}"
  145. Content="取消全选" />
  146. <Button
  147. Width="100"
  148. Margin="20,0"
  149. Command="{Binding ConfirmCommand}"
  150. Content="确认选择" />
  151. <Button
  152. Width="100"
  153. Margin="20,0"
  154. Command="{Binding CancelCommand}"
  155. Content="退出" />
  156. </StackPanel>
  157. <Border
  158. Grid.Row="2"
  159. BorderBrush="#FFA2C2E8"
  160. BorderThickness="1">
  161. <!-- 视图显示 -->
  162. <ListBox
  163. Margin="5"
  164. Background="Transparent"
  165. ItemsSource="{Binding AllRecipes}"
  166. ScrollViewer.VerticalScrollBarVisibility="Visible">
  167. <!--<ListBox.GroupStyle>
  168. <GroupStyle>
  169. <GroupStyle.ContainerStyle>
  170. <Style BasedOn="{StaticResource ListBoxGroupStyle}" TargetType="{x:Type GroupItem}" />
  171. </GroupStyle.ContainerStyle>
  172. </GroupStyle>
  173. </ListBox.GroupStyle>-->
  174. <ListBox.ItemTemplate>
  175. <DataTemplate>
  176. <StackPanel Orientation="Vertical">
  177. <StackPanel Orientation="Horizontal">
  178. <!--<CheckBox Margin="5" Command="{Binding DataContext.CheckCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}" IsChecked="{Binding IsSelected}">
  179. <CheckBox.CommandParameter>
  180. <MultiBinding Converter="{StaticResource CheckRecipeConverter}">
  181. <Binding Path="IsChecked" RelativeSource="{RelativeSource Self}" />
  182. <Binding Path="RecipeCode" />
  183. </MultiBinding>
  184. </CheckBox.CommandParameter>
  185. </CheckBox>-->
  186. <CheckBox
  187. Margin="5"
  188. IsChecked="{Binding IsSelected, Mode=TwoWay}" Style="{StaticResource CheckBoxLarge}"/>
  189. <TextBlock
  190. Margin="10"
  191. VerticalAlignment="Center"
  192. FontSize="16"
  193. Text="{Binding Recipe.RecipeCode, StringFormat=配方编号:{0}}" />
  194. <TextBlock
  195. Margin="10,0"
  196. VerticalAlignment="Center"
  197. FontSize="16"
  198. Text="{Binding Recipe.RecipeName, StringFormat=配方名称:{0}}" />
  199. </StackPanel>
  200. <Line
  201. Stroke="#FFA2C2E8"
  202. StrokeThickness="3"
  203. X1="0"
  204. X2="1000"
  205. Y1="0"
  206. Y2="0" />
  207. </StackPanel>
  208. </DataTemplate>
  209. </ListBox.ItemTemplate>
  210. </ListBox>
  211. </Border>
  212. </Grid>
  213. </Border>
  214. </Window>