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

180 lines
9.3 KiB

  1. <UserControl x:Class="BPASmart.RecipeManagement.View.OrderManager"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmart.RecipeManagement.View"
  7. xmlns:vm ="clr-namespace:BPASmart.RecipeManagement.ViewModel"
  8. mc:Ignorable="d"
  9. d:DesignHeight="450" d:DesignWidth="800" Background="Transparent">
  10. <UserControl.DataContext>
  11. <vm:OrderManagerViewModel/>
  12. </UserControl.DataContext>
  13. <UserControl.Resources>
  14. <Style TargetType="ListBoxItem">
  15. <Setter Property="Margin" Value="2"/>
  16. <Setter Property="FontSize" Value="22"/>
  17. <Setter Property="FontWeight" Value="Black"/>
  18. <Setter Property="Background" Value="#104E8B"/>
  19. <Setter Property="Template">
  20. <Setter.Value>
  21. <ControlTemplate TargetType="ListBoxItem">
  22. <Border BorderBrush="Black" BorderThickness="0" Background="{TemplateBinding Background}">
  23. <Grid HorizontalAlignment="Center" Margin="10 ">
  24. <Grid.RowDefinitions>
  25. <RowDefinition/>
  26. <RowDefinition/>
  27. <RowDefinition/>
  28. </Grid.RowDefinitions>
  29. <Grid.ColumnDefinitions>
  30. <ColumnDefinition />
  31. <ColumnDefinition />
  32. </Grid.ColumnDefinitions>
  33. <TextBlock
  34. Grid.Row="0"
  35. Margin="5,0,0,0"
  36. HorizontalAlignment="Right"
  37. VerticalAlignment="Center"
  38. Foreground="Orange"
  39. Text="配方:" />
  40. <TextBlock
  41. Grid.Row="1"
  42. Margin="5,0,0,0"
  43. HorizontalAlignment="Right"
  44. VerticalAlignment="Center"
  45. Foreground="Orange"
  46. Text="数量:" />
  47. <TextBlock
  48. Grid.Row="2"
  49. Margin="5,0,0,0"
  50. HorizontalAlignment="Right"
  51. VerticalAlignment="Center"
  52. Foreground="Orange"
  53. Text="已完成:" />
  54. <TextBlock
  55. Grid.Row="0"
  56. Grid.Column="1"
  57. Margin="5,0,0,0"
  58. HorizontalAlignment="Right"
  59. VerticalAlignment="Center"
  60. Foreground="Orange"
  61. Text="{Binding Name}" />
  62. <TextBlock
  63. Grid.Row="1"
  64. Grid.Column="1"
  65. Margin="5,0,0,0"
  66. HorizontalAlignment="Right"
  67. VerticalAlignment="Center"
  68. Foreground="Orange"
  69. Text="{Binding RecipeCount}" />
  70. <TextBlock
  71. Grid.Row="2"
  72. Grid.Column="1"
  73. Margin="5,0,0,0"
  74. HorizontalAlignment="Right"
  75. VerticalAlignment="Center"
  76. Foreground="Orange"
  77. Text="" />
  78. </Grid>
  79. </Border>
  80. </ControlTemplate>
  81. </Setter.Value>
  82. </Setter>
  83. </Style>
  84. <Style TargetType="ListViewItem" >
  85. <Setter Property="Margin" Value="10"/>
  86. <Setter Property="Background" Value="#104E8B"/>
  87. <Setter Property="Template">
  88. <Setter.Value>
  89. <ControlTemplate TargetType="ListViewItem">
  90. <Border x:Name="mborder" BorderBrush="#009AC0" BorderThickness="5,5,5,5" CornerRadius="5,5,5,5" Margin="10"
  91. Background="#104E8B">
  92. <Grid
  93. Background="Transparent"
  94. Name="tt"
  95. Height="250"
  96. Width="300"
  97. Margin="5">
  98. <Grid.RowDefinitions>
  99. <RowDefinition Height="30" />
  100. <RowDefinition Height="*" />
  101. <RowDefinition Height="2" />
  102. <RowDefinition Height="40" />
  103. </Grid.RowDefinitions>
  104. <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
  105. <TextBlock
  106. Grid.Row="0"
  107. Margin="2,5,0,0"
  108. HorizontalAlignment="Center"
  109. VerticalAlignment="Top"
  110. FontSize="18"
  111. Foreground="White"
  112. Text="下单时间: " />
  113. <TextBlock
  114. Grid.Row="0"
  115. Margin="2,5,0,0"
  116. HorizontalAlignment="Center"
  117. VerticalAlignment="Top"
  118. FontSize="18"
  119. Foreground="White"
  120. Text="{Binding OrderdateTime}" />
  121. </StackPanel>
  122. <ScrollViewer
  123. Grid.Row="1"
  124. Margin="20,10"
  125. VerticalAlignment="Top"
  126. Background="#104E8B"
  127. HorizontalScrollBarVisibility="Hidden"
  128. VerticalScrollBarVisibility="Auto">
  129. <ListBox ItemsSource="{Binding Recipes}" FontFamily="楷体" Background="#104E8B" >
  130. </ListBox>
  131. </ScrollViewer>
  132. <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
  133. <Button Content="执行订单" Width="100" Height="24" HorizontalAlignment="Right" Margin="10,0"
  134. Style="{DynamicResource ButtonStyle}"
  135. Command="{Binding }"
  136. />
  137. <Button Content="删除订单" Width="100" Height="24" HorizontalAlignment="Right" Margin="10,0"
  138. Style="{DynamicResource ButtonStyle}"
  139. Command="{Binding }"
  140. CommandParameter="{Binding}"/>
  141. </StackPanel>
  142. </Grid>
  143. </Border>
  144. <ControlTemplate.Triggers>
  145. <Trigger Property="IsMouseOver" Value="True">
  146. <Setter Property="BorderBrush" Value="#D2B48C" TargetName="mborder"/>
  147. </Trigger>
  148. <Trigger Property="IsFocused" Value="True">
  149. </Trigger>
  150. </ControlTemplate.Triggers>
  151. </ControlTemplate>
  152. </Setter.Value>
  153. </Setter>
  154. </Style>
  155. </UserControl.Resources>
  156. <Grid>
  157. <Grid.RowDefinitions>
  158. <RowDefinition Height="40"/>
  159. <RowDefinition />
  160. </Grid.RowDefinitions>
  161. <Button Content="创建订单" Width="100" Height="30" HorizontalAlignment="Right" Margin="10,0" Style="{DynamicResource ButtonStyle}"
  162. Command="{Binding CreateOrderCommand}"/>
  163. <ListView Grid.Row="1" Background="Transparent" Margin="10"
  164. ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding orders}" >
  165. <ListBox.ItemsPanel>
  166. <ItemsPanelTemplate>
  167. <WrapPanel Margin="10"/>
  168. </ItemsPanelTemplate>
  169. </ListBox.ItemsPanel>
  170. </ListView>
  171. </Grid>
  172. </UserControl>