|
- <Window
- x:Class="BPASmartClient.MorkCL.View.EditRecipeView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:Behaviors="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:converter="clr-namespace:BPASmartClient.MorkCL.Converter"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:BPASmartClient.MorkCL.ViewModel"
- Title="EditRecipeView"
- Width="900"
- Height="700"
- AllowsTransparency="True"
- Background="{x:Null}"
- Topmost="True"
- WindowStartupLocation="CenterScreen"
- WindowStyle="None"
- mc:Ignorable="d">
- <Window.DataContext>
- <vm:EditRecipeViewModel />
- </Window.DataContext>
- <Window.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="/BPASmartClient.MorkCL;component/CustomStyle/CustomStyle.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <converter:IndexConverter x:Key="indexConvert" />
- </ResourceDictionary>
- </Window.Resources>
- <Border
- Name="br"
- BorderBrush="#0CADF5"
- BorderThickness="0">
- <Border.Background>
- <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/弹框/z4.png" />
- </Border.Background>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="50" />
- <RowDefinition Height="1*" />
- </Grid.RowDefinitions>
- <!--#region 标题栏-->
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="DeepSkyBlue"
- Text="配方编辑界面" />
- <!--#endregion-->
-
- <!--#region 操作栏-->
- <Border
- Grid.Row="1"
- BorderBrush="#3099E5"
- BorderThickness="1">
- <DockPanel LastChildFill="False">
- <TextBlock
- Margin="5,0"
- DockPanel.Dock="Left"
- Text="配方名称:" />
- <TextBox
- Width="150"
- Height="35"
- DockPanel.Dock="Left"
- FontSize="18"
- Foreground="DeepSkyBlue"
- Text="{Binding Name}" />
- <!-- 只有炒菜,没有炖菜 -->
- <!--<TextBlock
- Margin="10,0"
- DockPanel.Dock="Left"
- Text="菜品类型:" />
- <ComboBox
- Width="150"
- Height="35"
- FontSize="18"
- IsReadOnly="True"
- ItemsSource="{Binding AllDishType}"
- Text="{Binding DishType}" />-->
- <Button
- Margin="10,0"
- Click="Button_Click"
- Content="取消并关闭"
- DockPanel.Dock="Right" />
- <Button
- Margin="10,0"
- Command="{Binding SaveParamCommand}"
- Content="保存参数"
- DockPanel.Dock="Right" />
- <Button
- Margin="10,0"
- Command="{Binding AddFuncCommand}"
- Content="添加功能"
- DockPanel.Dock="Right" />
- </DockPanel>
- </Border>
- <!--#endregion-->
-
- <!--#region 数据栏-->
- <Grid Grid.Row="2" Margin="5">
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition Height="1*" />
- </Grid.RowDefinitions>
- <!--#region 表格标题栏设置-->
- <Grid Margin="0,10,17,0" Background="#ff0C255F">
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="50" />
- <ColumnDefinition Width="230" />
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <Grid Grid.Column="0">
- <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="步骤" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <TextBlock
- Grid.Column="1"
- Style="{StaticResource TitleTextblockStyle}"
- Text="功能选择" />
-
- <Grid Grid.Column="2">
- <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="编辑" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Grid Grid.Column="3">
- <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="上移" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
- <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
- x:Name="contentControl"
- AlternationCount="{Binding Functions.Count}"
- ItemsSource="{Binding Functions}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid
- Name="gr"
- Height="40"
- Margin="0,5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="50" />
- <ColumnDefinition Width="230" />
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <Grid>
- <TextBlock
- Grid.Column="0"
- HorizontalAlignment="Center"
- Style="{StaticResource LeftAligentTextStyle}"
- Text="{Binding Path=(ItemsControl.AlternationIndex), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource indexConvert}}"
- TextAlignment="Right" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="2,0,2,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Grid Grid.Column="1">
- <ComboBox
- Height="40"
- FontSize="18"
- IsReadOnly="True"
- ItemsSource="{Binding DataContext.AllFunc, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
- Text="{Binding eFunc}">
- <Behaviors:Interaction.Triggers>
- <Behaviors:EventTrigger EventName="DropDownClosed">
- <Behaviors:InvokeCommandAction Command="{Binding DataContext.FuncChangeCommand, ElementName=contentControl}" CommandParameter="{Binding}" />
- </Behaviors:EventTrigger>
- <Behaviors:EventTrigger EventName="DropDownOpened">
- <Behaviors:InvokeCommandAction Command="{Binding DataContext.DropDownOenCommand, ElementName=contentControl}" CommandParameter="{Binding eFunc}" />
- </Behaviors:EventTrigger>
- <!--<Behaviors:EventTrigger EventName="PreviewMouseLeftButtonDown">
- <Behaviors:ChangePropertyAction PropertyName="IsDropDownOpen" Value="True"/>
- </Behaviors:EventTrigger>-->
- </Behaviors:Interaction.Triggers>
-
- </ComboBox>
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="2,0,2,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Grid Grid.Column="2">
- <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="3">
- <Button
- Command="{Binding DataContext.MoveUpCommand, 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">
- <Button
- Command="{Binding DataContext.MoveDownCommand, 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}"
- Content="删除"
- FontSize="16"
- Style="{StaticResource ControlButtonStyle}" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Border
- Grid.ColumnSpan="10"
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,1" />
- </Grid>
- <DataTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
- </Trigger>
- </DataTemplate.Triggers>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- <!--#endregion-->
- </Grid>
- <!--#endregion-->
- </Grid>
- </Border>
- </Window>
|