|
- <UserControl
- x:Class="BPASmartClient.MorkCL.View.RecipeManageView"
- 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:local="clr-namespace:BPASmartClient.MorkCL.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
- xmlns:vm="clr-namespace:BPASmartClient.MorkCL.ViewModel"
- Name="配方管理"
- mc:Ignorable="d">
- <UserControl.DataContext>
- <vm:RecipeManageViewModel />
- </UserControl.DataContext>
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
- <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
- <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Recdictionarys/GlobalStyle.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <Style x:Key="DataShowTextBoxStyle" TargetType="TextBox">
- <Setter Property="Margin" Value="5,0,0,0" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- <Setter Property="Height" Value="50" />
- <Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" />
- <Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="FontSize" Value="14" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="VerticalAlignment" Value="Center" />
- </Style>
-
- <Style
- x:Key="IssueRecipeButtonStyle"
- BasedOn="{StaticResource ControlButtonStyle}"
- TargetType="Button">
- <Setter Property="Foreground" Value="{StaticResource FontColor}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Border
- Name="TitleBarBr"
- BorderBrush="#00c2f4"
- BorderThickness="0"
- CornerRadius="0"
- Opacity="0.8">
-
- <ContentPresenter
- Margin="{TemplateBinding Margin}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- <Border.Background>
- <ImageBrush
- ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框2.1.png"
- Opacity="0.8"
- Stretch="Fill" />
- </Border.Background>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="TitleBarBr" Property="Opacity" Value="1" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition Height="1*" />
- </Grid.RowDefinitions>
-
- <!--#region 标题栏设置-->
- <pry:ImageBorder Grid.Row="0">
- <StackPanel
- Height="40"
- Margin="5,0"
- FlowDirection="RightToLeft"
- Orientation="Horizontal">
- <Button
- Height="35"
- Margin="10,0,50,0"
- VerticalAlignment="Center"
- Command="{Binding ClearAllRecipeCommand}"
- Content="清除所有配方" />
- <Button
- Height="35"
- Margin="5,0"
- VerticalAlignment="Center"
- Command="{Binding AddRecipeCommand}"
- Content="添加配方" />
- <Button
- Height="35"
- Margin="5,0"
- VerticalAlignment="Center"
- Command="{Binding AddTemplateRecipeCommand}"
- Content="添加模板配方" />
- <!--<Button
- Margin="5,0"
- VerticalAlignment="Center"
- Command="{Binding SaveParamCommand}"
- Content="保存所有配方" />-->
- </StackPanel>
- </pry:ImageBorder>
- <!--#endregion-->
-
- <!--#region 配方管理正文-->
- <pry:ImageBorder Grid.Row="1" Margin="5">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition Height="1*" />
- </Grid.RowDefinitions>
-
- <!--#region 标题栏设置-->
- <Grid Margin="0,10,17,0" Background="#ff0C255F">
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="400" />
- <ColumnDefinition Width="100" />
- <ColumnDefinition />
- <ColumnDefinition Width="200" />
- <ColumnDefinition Width="200" />
- <ColumnDefinition Width="100" />
- </Grid.ColumnDefinitions>
-
- <TextBlock
- Grid.Column="0"
- Style="{StaticResource TitleTextblockStyle}"
- Text="名称" />
-
- <Grid Grid.Column="1">
- <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="菜品类型" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Grid Grid.Column="2">
- <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="备注" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <TextBlock
- Grid.Column="3"
- Style="{StaticResource TitleTextblockStyle}"
- Text="下发" />
-
- <Grid Grid.Column="4">
- <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="编辑" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Grid Grid.Column="5">
- <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="删除" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Border
- Grid.ColumnSpan="10"
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0" />
- </Grid>
- <!--#endregion-->
-
- <!--#region 表格数据显示设置-->
- <Grid Grid.Row="1">
- <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Visible">
- <ItemsControl ItemsSource="{Binding Recipes}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="400" />
- <ColumnDefinition Width="100" />
- <ColumnDefinition />
- <ColumnDefinition Width="200" />
- <ColumnDefinition Width="200" />
- <ColumnDefinition Width="100" />
- </Grid.ColumnDefinitions>
-
- <TextBlock
- Grid.Column="0"
- HorizontalAlignment="Center"
- FontSize="26"
- Style="{StaticResource TextBlockStyle}"
- Text="{Binding Name}"
- TextAlignment="Center" />
-
- <Grid Grid.Column="1">
- <TextBox
- MinWidth="400"
- FontSize="26"
- Style="{StaticResource DataShowTextBoxStyle}"
- Text="{Binding DishType}"
- TextAlignment="Center" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="2,0,2,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Grid Grid.Column="2">
- <TextBox
- MinWidth="400"
- Style="{StaticResource DataShowTextBoxStyle}"
- Text="{Binding Remark}"
- TextAlignment="Center" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="2,0,2,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Grid Grid.Column="3" Margin="5">
- <Button
- Command="{Binding DataContext.IssueCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
- CommandParameter="{Binding}"
- Content="下发"
- FontSize="16"
- Style="{StaticResource IssueRecipeButtonStyle}" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="2,0,2,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Grid Grid.Column="4" Margin="5">
- <Button
- Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
- CommandParameter="{Binding}"
- Content="编辑"
- FontSize="16"
- Style="{StaticResource IssueRecipeButtonStyle}" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="2,0,2,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Grid Grid.Column="5">
- <Button
- Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
- CommandParameter="{Binding Id}"
- Content="删除"
- FontSize="16"
- Style="{StaticResource ControlButtonStyle}" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="2,0,2,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Border
- Grid.ColumnSpan="10"
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="2,0,2,2" />
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- <!--#endregion-->
- </Grid>
- </pry:ImageBorder>
- <!--#endregion-->
- </Grid>
- </UserControl>
|