终端一体化运控平台
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.2 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">
  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="Template">
  18. <Setter.Value>
  19. <ControlTemplate TargetType="ListBoxItem">
  20. <Border BorderBrush="Black" BorderThickness="1">
  21. <Grid HorizontalAlignment="Center" Margin="10 ">
  22. <Grid.RowDefinitions>
  23. <RowDefinition/>
  24. <RowDefinition/>
  25. <RowDefinition/>
  26. </Grid.RowDefinitions>
  27. <Grid.ColumnDefinitions>
  28. <ColumnDefinition />
  29. <ColumnDefinition />
  30. </Grid.ColumnDefinitions>
  31. <TextBlock
  32. Grid.Row="0"
  33. Margin="5,0,0,0"
  34. HorizontalAlignment="Right"
  35. VerticalAlignment="Center"
  36. Foreground="Black"
  37. Text="配方:" />
  38. <TextBlock
  39. Grid.Row="1"
  40. Margin="5,0,0,0"
  41. HorizontalAlignment="Right"
  42. VerticalAlignment="Center"
  43. Foreground="Black"
  44. Text="数量:" />
  45. <TextBlock
  46. Grid.Row="2"
  47. Margin="5,0,0,0"
  48. HorizontalAlignment="Right"
  49. VerticalAlignment="Center"
  50. Foreground="Black"
  51. Text="已完成:" />
  52. <TextBlock
  53. Grid.Row="0"
  54. Grid.Column="1"
  55. Margin="5,0,0,0"
  56. HorizontalAlignment="Right"
  57. VerticalAlignment="Center"
  58. Foreground="Black"
  59. Text="{Binding Name}" />
  60. <TextBlock
  61. Grid.Row="1"
  62. Grid.Column="1"
  63. Margin="5,0,0,0"
  64. HorizontalAlignment="Right"
  65. VerticalAlignment="Center"
  66. Foreground="Black"
  67. Text="{Binding RecipeCount}" />
  68. <TextBlock
  69. Grid.Row="2"
  70. Grid.Column="1"
  71. Margin="5,0,0,0"
  72. HorizontalAlignment="Right"
  73. VerticalAlignment="Center"
  74. Foreground="Black"
  75. Text="" />
  76. </Grid>
  77. </Border>
  78. </ControlTemplate>
  79. </Setter.Value>
  80. </Setter>
  81. </Style>
  82. <Style TargetType="ListViewItem" >
  83. <Setter Property="Margin" Value="10"/>
  84. <Setter Property="Template">
  85. <Setter.Value>
  86. <ControlTemplate TargetType="ListViewItem">
  87. <Border x:Name="mborder" BorderBrush="#009AC0" BorderThickness="3,3,3,10" CornerRadius="10" Margin="10"
  88. Background="White">
  89. <Border.Effect>
  90. <DropShadowEffect Color="#696969" Direction="215" ShadowDepth="10" Opacity="0.8"/>
  91. </Border.Effect>
  92. <Grid
  93. Name="tt"
  94. Height="250"
  95. Width="300"
  96. Margin="5">
  97. <Grid.RowDefinitions>
  98. <RowDefinition Height="30" />
  99. <RowDefinition Height="*" />
  100. <RowDefinition Height="2" />
  101. <RowDefinition Height="40" />
  102. </Grid.RowDefinitions>
  103. <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
  104. <TextBlock
  105. Grid.Row="0"
  106. Margin="2,5,0,0"
  107. HorizontalAlignment="Center"
  108. VerticalAlignment="Top"
  109. FontSize="18"
  110. Foreground="Black"
  111. Text="下单时间: " />
  112. <TextBlock
  113. Grid.Row="0"
  114. Margin="2,5,0,0"
  115. HorizontalAlignment="Center"
  116. VerticalAlignment="Top"
  117. FontSize="18"
  118. Foreground="Black"
  119. Text="{Binding OrderdateTime}" />
  120. </StackPanel>
  121. <ScrollViewer
  122. Grid.Row="1"
  123. Margin="20,10"
  124. VerticalAlignment="Top"
  125. Background="Transparent"
  126. HorizontalScrollBarVisibility="Hidden"
  127. VerticalScrollBarVisibility="Auto">
  128. <ListBox ItemsSource="{Binding Recipes}" FontFamily="楷体">
  129. </ListBox>
  130. </ScrollViewer>
  131. <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
  132. <Button Content="执行订单" Width="100" Height="24" HorizontalAlignment="Right" Margin="10,0"
  133. Background="#58B0ED" Foreground="White"
  134. Command="{Binding }"
  135. />
  136. <Button Content="删除订单" Width="100" Height="24" HorizontalAlignment="Right" Margin="10,0"
  137. Background="#58B0ED" Foreground="White"
  138. Command="{Binding }"
  139. CommandParameter="{Binding}"/>
  140. </StackPanel>
  141. </Grid>
  142. </Border>
  143. <ControlTemplate.Triggers>
  144. <Trigger Property="IsMouseOver" Value="True">
  145. <Setter Property="BorderBrush" Value="#D2B48C" TargetName="mborder"/>
  146. </Trigger>
  147. <Trigger Property="IsFocused" Value="True">
  148. </Trigger>
  149. </ControlTemplate.Triggers>
  150. </ControlTemplate>
  151. </Setter.Value>
  152. </Setter>
  153. </Style>
  154. </UserControl.Resources>
  155. <Grid>
  156. <Grid.RowDefinitions>
  157. <RowDefinition Height="40"/>
  158. <RowDefinition />
  159. </Grid.RowDefinitions>
  160. <Button Content="创建订单" Width="100" Height="30" HorizontalAlignment="Right" Margin="10,0"
  161. Background="#58B0ED" Foreground="White" Command="{Binding CreateOrderCommand}"/>
  162. <ListView Grid.Row="1"
  163. ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding orders}" Background="#FFFAFA" >
  164. <ListBox.ItemsPanel>
  165. <ItemsPanelTemplate>
  166. <WrapPanel Margin="10"/>
  167. </ItemsPanelTemplate>
  168. </ListBox.ItemsPanel>
  169. </ListView>
  170. </Grid>
  171. </UserControl>