|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- <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>
|