终端一体化运控平台
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

223 rindas
11 KiB

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