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