|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <UserControl x:Class="BPASmartClient.MorkBF.VIew.MenuView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmartClient.MorkBF.VIew"
- xmlns:vm="clr-namespace:BPASmartClient.MorkBF.ViewModel"
- x:Name="菜单"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.DataContext>
- <vm:MenuViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
- <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="100"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <Button Content="添加新菜品" Width="200" Click="Button_Click"/>
- <ListBox Grid.Row="1" ItemsSource="{Binding fryPotMessages}">
- <ListBox.Template>
- <ControlTemplate TargetType="{x:Type ListBox}">
- <WrapPanel Orientation="Horizontal" IsItemsHost="True"></WrapPanel>
- </ControlTemplate>
- </ListBox.Template>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Border Margin="5,10">
- <Border.Background>
- <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/矩形.png"/>
- </Border.Background>
- <Grid Margin="0,5,0,10">
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <StackPanel Orientation="Horizontal" Margin="10">
- <TextBlock Text="{Binding GoodName}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Margin="10,0"/>
- <Button Content="编辑" Command="{Binding DataContext.MenuEditCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
- CommandParameter="{Binding DataContext , RelativeSource={RelativeSource AncestorType=ListBoxItem,Mode=FindAncestor}}" Margin="10,0"/>
- <Button Content="删除 " Command="{Binding DataContext.MenuDeleteCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
- CommandParameter="{Binding DataContext , RelativeSource={RelativeSource AncestorType=ListBoxItem,Mode=FindAncestor}}" Margin="10,0"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center">
- <Button Grid.Row="1" Content="下单_炒锅1" Width="120" HorizontalAlignment="Center" VerticalAlignment="Center"
- Command="{Binding DataContext.FryPot1_StartOrderCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
- CommandParameter="{Binding DataContext , RelativeSource={RelativeSource AncestorType=ListBoxItem,Mode=FindAncestor}}" Margin="5,5"/>
- <Button Grid.Row="1" Content="下单_炒锅2" Width="120" HorizontalAlignment="Center" VerticalAlignment="Center"
- Command="{Binding DataContext.FryPot2_StartOrderCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
- CommandParameter="{Binding DataContext , RelativeSource={RelativeSource AncestorType=ListBoxItem,Mode=FindAncestor}}" Margin="5,5"/>
- </StackPanel>
- </Grid>
-
- </Border>
-
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </Grid>
- </UserControl>
|