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

69 lines
4.5 KiB

  1. <UserControl x:Class="BPASmartClient.MorkBF.VIew.MenuView"
  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:BPASmartClient.MorkBF.VIew"
  7. xmlns:vm="clr-namespace:BPASmartClient.MorkBF.ViewModel"
  8. x:Name="菜单"
  9. mc:Ignorable="d"
  10. d:DesignHeight="450" d:DesignWidth="800">
  11. <UserControl.DataContext>
  12. <vm:MenuViewModel/>
  13. </UserControl.DataContext>
  14. <UserControl.Resources>
  15. <ResourceDictionary>
  16. <ResourceDictionary.MergedDictionaries>
  17. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
  18. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
  19. </ResourceDictionary.MergedDictionaries>
  20. </ResourceDictionary>
  21. </UserControl.Resources>
  22. <Grid>
  23. <Grid.RowDefinitions>
  24. <RowDefinition Height="100"/>
  25. <RowDefinition Height="*"/>
  26. </Grid.RowDefinitions>
  27. <Button Content="添加新菜品" Width="200" Click="Button_Click"/>
  28. <ListBox Grid.Row="1" ItemsSource="{Binding fryPotMessages}">
  29. <ListBox.Template>
  30. <ControlTemplate TargetType="{x:Type ListBox}">
  31. <WrapPanel Orientation="Horizontal" IsItemsHost="True"></WrapPanel>
  32. </ControlTemplate>
  33. </ListBox.Template>
  34. <ListBox.ItemTemplate>
  35. <DataTemplate>
  36. <Border Margin="5,10">
  37. <Border.Background>
  38. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/矩形.png"/>
  39. </Border.Background>
  40. <Grid Margin="0,5,0,10">
  41. <Grid.RowDefinitions>
  42. <RowDefinition Height="*"/>
  43. <RowDefinition Height="*"/>
  44. </Grid.RowDefinitions>
  45. <StackPanel Orientation="Horizontal" Margin="10">
  46. <TextBlock Text="{Binding GoodName}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Margin="10,0"/>
  47. <Button Content="编辑" Command="{Binding DataContext.MenuEditCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
  48. CommandParameter="{Binding DataContext , RelativeSource={RelativeSource AncestorType=ListBoxItem,Mode=FindAncestor}}" Margin="10,0"/>
  49. <Button Content="删除 " Command="{Binding DataContext.MenuDeleteCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
  50. CommandParameter="{Binding DataContext , RelativeSource={RelativeSource AncestorType=ListBoxItem,Mode=FindAncestor}}" Margin="10,0"/>
  51. </StackPanel>
  52. <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center">
  53. <Button Grid.Row="1" Content="下单_炒锅1" Width="120" HorizontalAlignment="Center" VerticalAlignment="Center"
  54. Command="{Binding DataContext.FryPot1_StartOrderCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
  55. CommandParameter="{Binding DataContext , RelativeSource={RelativeSource AncestorType=ListBoxItem,Mode=FindAncestor}}" Margin="5,5"/>
  56. <Button Grid.Row="1" Content="下单_炒锅2" Width="120" HorizontalAlignment="Center" VerticalAlignment="Center"
  57. Command="{Binding DataContext.FryPot2_StartOrderCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
  58. CommandParameter="{Binding DataContext , RelativeSource={RelativeSource AncestorType=ListBoxItem,Mode=FindAncestor}}" Margin="5,5"/>
  59. </StackPanel>
  60. </Grid>
  61. </Border>
  62. </DataTemplate>
  63. </ListBox.ItemTemplate>
  64. </ListBox>
  65. </Grid>
  66. </UserControl>