|
- <UserControl x:Class="BPASmartClient.MilkWithTea.View.LocalConfigureView"
- 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.MilkWithTea.View"
- xmlns:vm="clr-namespace:BPASmartClient.MilkWithTea.ViewModel"
- mc:Ignorable="d"
- d:DesignHeight="800" d:DesignWidth="1400" Background="Transparent">
- <UserControl.DataContext>
- <vm:LocalConfigureViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
- <Style TargetType="Button">
- <Setter Property="Width" Value="90"/>
- <Setter Property="Height" Value="20"/>
- <Setter Property="Foreground" Value="White"/>
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="Background" Value="#43a9c7"/>
- <Setter Property="FontSize" Value="16"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
- <TextBlock Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="border" Property="Background" Value="#2f96b4"/>
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="border" Property="Background" Value="#2a89a4"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style TargetType="ListViewItem" >
- <Setter Property="Margin" Value="60,20"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListViewItem">
- <Border Padding="4" x:Name="mborder" BorderBrush="Transparent" BorderThickness="1">
-
- <Border >
- <Grid Width="250" >
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <TextBlock Text="{Binding MaterialPosition}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10,0"/>
- <TextBox Text="{Binding MaterialName}" Grid.Column="1" Width="140"
- HorizontalAlignment="Center" VerticalAlignment="Center"></TextBox>
- </Grid>
- </Border>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
-
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <Grid Background="#F3F6F9" Margin="20">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="40"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <Button Content="奶茶配方录入" HorizontalAlignment="Right" VerticalAlignment="Center" Width="150" Click="Button_Click"/>
- <ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible" Grid.Row="1">
- <StackPanel>
- <!--奶茶配方录入-->
- <!--<Expander Style="{StaticResource ExpanderStyle}">
- <Expander.Header>
- <TextBlock Text="奶茶配方录入" />
- </Expander.Header>
- <Expander.Content>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="80"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <StackPanel Orientation="Horizontal" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="40,0">
- <TextBlock Text="奶茶名称:" Foreground="DarkSlateGray" FontSize="20" Margin="10,0" VerticalAlignment="Center" />
- <TextBox Text="{Binding LocalGoodName}" Width="120" FontSize="16" Margin="10,0" VerticalContentAlignment="Center" Padding="2"/>
- <Button Content="添加配方" Margin="10,0" Width="120" Command="{Binding AddRecipeCommand}" Style="{StaticResource buttonNormal}"/>
- <Button Content="保存" Margin="10,0" Width="80" Command="{Binding SaveRecipeCommand}" Style="{StaticResource buttonNormal}"/>
- <Button Content="清空" Margin="10,0" Width="80" Command="{Binding RecipeCancelCommand}" Style="{StaticResource buttonNormal}"/>
- </StackPanel>
- <DataGrid Grid.Row="1" Margin="100,5,100,20" AutoGenerateColumns="False" RowHeight="32" ItemsSource="{Binding materialRecipes}"
- x:Name="recipeDataGrid"
- FrozenColumnCount="1"
- VerticalAlignment="Center" HorizontalAlignment="Center"
- Background="#F3F6F9"
- IsReadOnly="True"
- CanUserResizeColumns="False" CanUserResizeRows="False" SelectionMode="Single"
- CanUserReorderColumns="False" AlternationCount="2" RowHeaderWidth="0" CanUserAddRows="False" >
- <DataGrid.Columns >
- <DataGridTemplateColumn Header="ID" Width="40">
- <DataGridTemplateColumn.CellTemplate >
- <DataTemplate>
- <TextBlock Text="{ Binding MaterialID}" Foreground="Black"
- VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5"/>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Header="配料" Width="200">
- <DataGridTemplateColumn.CellTemplate >
- <DataTemplate>
- <ComboBox x:Name="combox" FontSize="16" Width="100" VerticalContentAlignment="Top"
- ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.MaterailList}"
- IsReadOnly="True" Style="{StaticResource cmbstyle}" Height="30"
- SelectedIndex="1"
- SelectedValue="{Binding Material ,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Header="配料量" Width="175" >
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal" Margin="3" >
- <TextBox Text="{Binding MaterialWeight}" VerticalAlignment="Center" HorizontalAlignment="Center" Width="50" FontSize="16"/>
- <TextBlock Text="g" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,0" FontSize="16" Foreground="Black"/>
- </StackPanel>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
-
- <DataGridTemplateColumn Header="操作" Width="300">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
- <Button Margin="4"
- Content="删除" Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.RemoveRecipeCommand}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}, Path=SelectedIndex}" />
- </StackPanel>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- </DataGrid.Columns>
- </DataGrid>
- </Grid>
- </Expander.Content>
- </Expander>-->
- <!--配料录入-->
- <Expander Grid.Row="1" Style="{StaticResource ExpanderStyle}">
- <Expander.Header>
- <TextBlock Text="本地配料录入" />
- </Expander.Header>
- <Expander.Content>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="70"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <Button Content="保存物料位置名称" Grid.ColumnSpan="2" Style="{StaticResource buttonNormal}" Height="34" Width="200"
- Command="{Binding UpdateMaterialPosionCommand}"/>
- <ListView ItemsSource="{Binding localMaterails}" Grid.Row="1"
- Width="800" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- HorizontalAlignment="Center" VerticalAlignment="Center">
- <ListView.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel Margin="10"/>
- </ItemsPanelTemplate>
- </ListView.ItemsPanel>
- </ListView>
- </Grid>
- </Expander.Content>
- </Expander>
- <!--奶茶清单-->
- <Expander Grid.Row="2" Style="{StaticResource ExpanderStyle}" >
- <Expander.Header>
- <TextBlock Text="本地奶茶配方"/>
- </Expander.Header>
- <Expander.Content>
- <DataGrid Grid.Row="4" Margin="100,5" AutoGenerateColumns="False" RowHeight="32" ItemsSource="{Binding localMaterialRecipes}" Width="500"
- FrozenColumnCount="1"
- VerticalAlignment="Top"
- IsReadOnly="True"
- CanUserResizeColumns="False" CanUserResizeRows="False" SelectionMode="Single"
- CanUserReorderColumns="False" AlternationCount="2" RowHeaderWidth="0" CanUserAddRows="False">
- <DataGrid.Columns>
- <DataGridTemplateColumn Header="奶茶" Width="200">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal" >
- <TextBlock Text="{Binding RecipeName}" Foreground="Black"
- VerticalAlignment="Center" HorizontalAlignment="Center"
- Margin="5,2" FontSize="16"/>
- </StackPanel>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Header="操作" Width="*">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
- <Button Content="删除" Margin="2"
- Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.DeleteRecipeCommand}"
- CommandParameter="{Binding RecipeID}"/>
- </StackPanel>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- </DataGrid.Columns>
- </DataGrid>
- </Expander.Content>
- </Expander>
- </StackPanel>
- </ScrollViewer>
- </Grid>
-
- </Grid>
- </UserControl>
|