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

196 lines
12 KiB

  1. <UserControl x:Class="BPASmartClient.MorkS.View.GoodsMakeView"
  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:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  7. xmlns:local="clr-namespace:BPASmartClient.MorkS.View"
  8. xmlns:vm="clr-namespace:BPASmartClient.MorkS.ViewModel"
  9. mc:Ignorable="d"
  10. Name="制作界面"
  11. d:DesignHeight="450" d:DesignWidth="800">
  12. <UserControl.DataContext>
  13. <vm:GoodsMakeViewModel/>
  14. </UserControl.DataContext>
  15. <UserControl.Resources>
  16. <Style x:Key="BtnStyle" TargetType="Button">
  17. <Setter Property="Template">
  18. <Setter.Value>
  19. <ControlTemplate TargetType="{x:Type Button}" >
  20. <Border x:Name="border" CornerRadius="3" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
  21. <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  22. </Border>
  23. <ControlTemplate.Triggers>
  24. <!--<Trigger Property="IsMouseOver" Value="True">
  25. <Setter Property="Background" TargetName="border" Value="#FF3225"/>
  26. </Trigger>
  27. <Trigger Property="IsPressed" Value="true">
  28. <Setter Property="Background" TargetName="border" Value="IndianRed"/>
  29. </Trigger>-->
  30. </ControlTemplate.Triggers>
  31. </ControlTemplate>
  32. </Setter.Value>
  33. </Setter>
  34. <Style.Triggers>
  35. </Style.Triggers>
  36. </Style>
  37. <Style x:Key="SwitchToggleButtonStyle1" TargetType="{x:Type ToggleButton}">
  38. <Setter Property="Template">
  39. <Setter.Value>
  40. <ControlTemplate TargetType="{x:Type ToggleButton}">
  41. <Viewbox>
  42. <Grid x:Name="gr" Opacity="0.8">
  43. <Border
  44. x:Name="border2"
  45. Width="{TemplateBinding Width}"
  46. Height="{TemplateBinding Height}"
  47. HorizontalAlignment="Left"
  48. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  49. Background="Red"
  50. BorderBrush="{TemplateBinding BorderBrush}"
  51. CornerRadius="15">
  52. <ContentPresenter
  53. Margin="{TemplateBinding Padding}"
  54. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  55. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  56. RecognizesAccessKey="True"
  57. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  58. Visibility="Collapsed" />
  59. </Border>
  60. <Ellipse
  61. Name="ell"
  62. Width="{TemplateBinding Height}"
  63. Height="{TemplateBinding Height}"
  64. Margin="0"
  65. HorizontalAlignment="Left"
  66. VerticalAlignment="Center"
  67. Fill="#ddd" />
  68. <TextBlock
  69. Name="tb"
  70. Margin="34,0,10,0"
  71. HorizontalAlignment="Right"
  72. VerticalAlignment="Center"
  73. Foreground="White"
  74. Text="{TemplateBinding Content}" />
  75. </Grid>
  76. </Viewbox>
  77. <ControlTemplate.Triggers>
  78. <!-- 控件选中 -->
  79. <Trigger Property="IsChecked" Value="true">
  80. <Setter TargetName="ell" Property="HorizontalAlignment" Value="Right" />
  81. <Setter TargetName="border2" Property="Background" Value="#FF2AB2E7" />
  82. <Setter TargetName="tb" Property="Margin" Value="0,0,45,0" />
  83. </Trigger>
  84. <!-- 控件未选中 -->
  85. <Trigger Property="IsChecked" Value="false">
  86. <Setter TargetName="border2" Property="Background" Value="gray" />
  87. <Setter TargetName="tb" Property="HorizontalAlignment" Value="Right" />
  88. </Trigger>
  89. <!-- 鼠标进入 -->
  90. <Trigger Property="IsMouseOver" Value="True">
  91. <Setter TargetName="gr" Property="Opacity" Value="1" />
  92. </Trigger>
  93. <!-- 控件禁用 -->
  94. <Trigger Property="IsEnabled" Value="false">
  95. <Setter TargetName="gr" Property="Opacity" Value="0.5" />
  96. </Trigger>
  97. <!-- 控件启用 -->
  98. <Trigger Property="IsEnabled" Value="True">
  99. <Setter TargetName="gr" Property="Opacity" Value="0.8" />
  100. </Trigger>
  101. </ControlTemplate.Triggers>
  102. </ControlTemplate>
  103. </Setter.Value>
  104. </Setter>
  105. </Style>
  106. </UserControl.Resources>
  107. <Grid>
  108. <Grid.RowDefinitions>
  109. <RowDefinition Height="50"/>
  110. <RowDefinition Height="30"/>
  111. <RowDefinition/>
  112. </Grid.RowDefinitions>
  113. <UniformGrid Columns="2" HorizontalAlignment="Right" VerticalAlignment="Center">
  114. <Button Content="新增订单" Command="{Binding EditCommand}" Style="{StaticResource ButtonStyle}" FontSize="22" />
  115. <ToggleButton
  116. x:Name="togFire"
  117. Width="90"
  118. Height="30"
  119. Margin="0,6,5.5,3.5"
  120. Background="Transparent"
  121. Click="togFire_Click"
  122. Content="小程序"
  123. FontSize="18"
  124. Style="{StaticResource SwitchToggleButtonStyle1}" />
  125. </UniformGrid>
  126. <Grid Background="#FF2AB2E7" Name="formHead" Grid.Row="1">
  127. <Grid.ColumnDefinitions>
  128. <ColumnDefinition/>
  129. <ColumnDefinition/>
  130. <ColumnDefinition/>
  131. <ColumnDefinition/>
  132. </Grid.ColumnDefinitions>
  133. <TextBlock Text="商品" Margin="3,0,4,0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" FontFamily="微软雅黑" Foreground="White" />
  134. <GridSplitter Background="Transparent" Width="1" />
  135. <TextBlock Grid.Column="1" Margin="3,0,4,0" Text="面条位置" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" FontFamily="微软雅黑" Foreground="White"/>
  136. <GridSplitter Grid.Column="1" Background="Transparent" Width="1"/>
  137. <TextBlock Grid.Column="2" Margin="3,0,4,0" Text="碗位置" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" FontFamily="微软雅黑" Foreground="White"/>
  138. <GridSplitter Grid.Column="2" Background="Transparent" Width="1"/>
  139. <TextBlock Grid.Column="3" Margin="3,0,4,0" Text="操作" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" FontFamily="微软雅黑" Foreground="White"/>
  140. </Grid>
  141. <ItemsControl Grid.Row="2" ItemsSource="{Binding GoodsModels}">
  142. <ItemsControl.ItemsPanel>
  143. <ItemsPanelTemplate>
  144. <StackPanel/>
  145. </ItemsPanelTemplate>
  146. </ItemsControl.ItemsPanel>
  147. <ItemsControl.ItemTemplate>
  148. <DataTemplate>
  149. <Border BorderThickness="0,0,0,1" BorderBrush="#FF2AB2E7">
  150. <Grid>
  151. <Grid.ColumnDefinitions>
  152. <ColumnDefinition/>
  153. <ColumnDefinition/>
  154. <ColumnDefinition/>
  155. <ColumnDefinition/>
  156. </Grid.ColumnDefinitions>
  157. <TextBlock Margin="0,8" Foreground="#2AB2E7" Text="{Binding GoodsName}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  158. <TextBlock Grid.Column="1" Foreground="#2AB2E7" Text="{Binding NoodlesLoc}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  159. <TextBlock Grid.Column="2" Foreground="#2AB2E7" Text="{Binding BowlLoc}" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  160. <UniformGrid Columns="2" Grid.Column="3">
  161. <Button IsEnabled="{Binding ElementName=togFire,Path=IsChecked}" Command="{Binding DataContext.SendOrderCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}" CommandParameter="{Binding OrderNum}" HorizontalAlignment="Center" Background="Transparent"
  162. VerticalAlignment="Center" BorderThickness="0" Content="点击下单" FontSize="16" Cursor="Hand" Style="{StaticResource BtnStyle}">
  163. <Button.Foreground>
  164. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  165. <GradientStop Color="Orange" />
  166. <GradientStop Offset="1.2" Color="White" />
  167. </LinearGradientBrush>
  168. </Button.Foreground>
  169. </Button>
  170. <Button Command="{Binding DataContext.DeleteOrderCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}" CommandParameter="{Binding OrderNum}" HorizontalAlignment="Center" Background="Transparent"
  171. VerticalAlignment="Center" BorderThickness="0" Content="删除订单" FontSize="16" Cursor="Hand" Style="{StaticResource BtnStyle}">
  172. <Button.Foreground>
  173. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  174. <GradientStop Color="Orange" />
  175. <GradientStop Offset="1.2" Color="White" />
  176. </LinearGradientBrush>
  177. </Button.Foreground>
  178. </Button>
  179. </UniformGrid>
  180. </Grid>
  181. </Border>
  182. </DataTemplate>
  183. </ItemsControl.ItemTemplate>
  184. </ItemsControl>
  185. </Grid>
  186. </UserControl>