|
- <Window x:Class="BPASmartClient.MilkWithTea.View.RecipeConfige"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:BPASmartClient.MilkWithTea.View"
- xmlns:vm="clr-namespace:BPASmartClient.MilkWithTea.ViewModel"
- mc:Ignorable="d"
- Title="RecipeConfige"
- Height="800" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True"
- >
- <Window.DataContext>
- <vm:RecipeConfigeViewModel/>
- </Window.DataContext>
- <Window.Resources>
-
-
-
- </Window.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="60"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="*"/>
-
- </Grid.RowDefinitions>
-
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
- <TextBlock Text="奶茶名称" Margin="10,0" />
- <TextBox Text="{Binding Name}" Width="120" Foreground="DarkSlateGray" Margin="10,0"/>
- <Button Content="添加配料" Margin="10,0" Width="100" Command="{Binding AddMaterialCommand}"/>
- <Button Content="保存" Margin="10,0" Width="100" Command="{Binding SaveCommand}"/>
- <Button Content="取消" Margin="10,0" Width="100" Click="Button_Click"/>
- </StackPanel>
- <Grid Grid.Row="1">
- <ScrollViewer
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Auto">
- <ItemsControl ItemsSource="{Binding Materails}" >
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <RadioButton GroupName="all">
- <RadioButton.Template>
- <ControlTemplate TargetType="RadioButton">
- <Grid Name="gr" Height="40" Margin="20,0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="2*"/>
- <ColumnDefinition Width="2*"/>
- <ColumnDefinition Width="2*" />
- </Grid.ColumnDefinitions>
- <ComboBox Name="cb" Width="120" Height="30"
- ItemsSource="{Binding DataContext.materialNames, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
- SelectedValue="{Binding MaterialID}"
-
- SelectedValuePath="Key" DisplayMemberPath="Value"/>
- <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
- <TextBox Text="{Binding MaterialWeight}" Width="120" Margin="10,0"/>
- <TextBlock Text="g" />
- </StackPanel>
- <Button Grid.Column="2"
- Width="70"
- Height="25"
- Margin="15,0,0,0"
- FontSize="16"
- BorderBrush="#FF2AB2E7"
- BorderThickness="1"
- HorizontalAlignment="Left"
-
- Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
- CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}"
- Content="删 除" />
-
- </Grid>
-
-
- </ControlTemplate>
- </RadioButton.Template>
- </RadioButton>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- <Grid Grid.Row="2">
- <ListBox x:Name="listview1" AllowDrop="True" SelectionMode="Extended" MouseMove="listview1_MouseMove"
- ItemsSource="{Binding Materails}" PreviewMouseLeftButtonUp="listview1_MouseLeftButtonUp">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Border PreviewMouseLeftButtonDown="listview1_MouseLeftButtonDown" Width="800" BorderBrush="Black" BorderThickness="1" Background="White"
- >
- <RadioButton GroupName="all" >
- <RadioButton.Template>
- <ControlTemplate TargetType="RadioButton">
- <Grid Name="gr" Height="40" Margin="20,0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="2*"/>
- <ColumnDefinition Width="2*"/>
- <ColumnDefinition Width="2*" />
- </Grid.ColumnDefinitions>
- <ComboBox Name="cb" Width="120" Height="30"
- ItemsSource="{Binding DataContext.materialNames, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
- SelectedValue="{Binding MaterialID }"
-
- SelectedValuePath="Key" DisplayMemberPath="Value"/>
- <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
- <TextBox Text="{Binding MaterialWeight}" Width="120" Margin="10,0"/>
- <TextBlock Text="g" />
- </StackPanel>
- <Button Grid.Column="2"
- Width="70"
- Height="25"
- Margin="15,0,0,0"
- FontSize="16"
- BorderBrush="#FF2AB2E7"
- BorderThickness="1"
- HorizontalAlignment="Left"
-
- Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
- CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}"
- Content="删 除" />
- </Grid>
-
-
- </ControlTemplate>
- </RadioButton.Template>
- </RadioButton>
- </Border>
-
- </DataTemplate>
- </ListBox.ItemTemplate>
-
- </ListBox>
- </Grid>
- </Grid>
- </Window>
|