Browse Source

ProcessRecipe/LayoutRecipe/JobRecipe调整为 文件夹独立布局

git-svn-id: http://10.4.3.168:50001/svn/Furnace@76 dbcde07d-dcf5-c148-8a84-ac3097b7778e
Jiangjinyuan 2 months ago
parent
commit
b048a2340a

+ 132 - 32
Furnace/FurnaceUI/Views/Recipes/RecipeJobView.xaml

@@ -1,5 +1,6 @@
 <UserControl
     x:Class="FurnaceUI.Views.Recipes.RecipeJobView"
+
     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"
@@ -30,6 +31,7 @@
                     FontSize="15"
                     TextWrapping="Wrap"
                     Text="{Binding Name}"/>
+
             </StackPanel>
             <HierarchicalDataTemplate.Triggers>
                 <Trigger Property="IsEnabled" Value="false">
@@ -40,15 +42,6 @@
         <HierarchicalDataTemplate x:Key="FileTemplate" ItemsSource="{Binding Files}">
             <StackPanel Orientation="Horizontal" Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=DataContext}">
                 <Path
-                    Width="8"
-                    Height="10"
-                    HorizontalAlignment="Left"
-                    Data="M1,0 L7,10 M7,0 1,10"
-                    Stretch="Fill"
-                    Stroke="Red"
-                    StrokeThickness="2"
-                    Visibility="{Binding IsVisiable}"/>
-                <Path
                     Width="13"
                     Height="16"
                     HorizontalAlignment="Left"
@@ -62,9 +55,9 @@
                     VerticalAlignment="Center"
                     FontFamily="Segoe"
                     FontSize="15"
-                    TextWrapping="Wrap"
                     Text="{Binding Name}"
-                    TextAlignment="Left"/>
+                    TextAlignment="Left"
+                    TextWrapping="Wrap"/>
                 <TextBlock
                     Width="100"
                     HorizontalAlignment="Center"
@@ -79,13 +72,12 @@
                     FontSize="15"
                     Text="{Binding Revisor}"
                     TextAlignment="Center"/>
-                <!--<TextBlock Width="100" Text="{Binding Permission}" FontSize="15"  VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center"/>-->
                 <TextBlock
                     Width="280"
                     HorizontalAlignment="Center"
                     VerticalAlignment="Center"
                     FontSize="15"
-                    TextWrapping="Wrap"
+                    
                     Text="{Binding Description}"
                     TextAlignment="Center"/>
                 <TextBlock
@@ -106,14 +98,103 @@
     </UserControl.Resources>
     <Grid IsEnabled="{Binding IsPermission}">
         <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="220"/>
             <ColumnDefinition Width="*"/>
             <ColumnDefinition Width="200"/>
         </Grid.ColumnDefinitions>
-        <TabControl
-            Grid.Column="0"
-            Margin="0,-1,0,-10"
+        <Border BorderBrush="Black" BorderThickness="1" Background="#DAE5F1">
+            <TreeView      ScrollViewer.HorizontalScrollBarVisibility="Hidden"
+  ItemsSource="{Binding ProcessTypeFileList[0].FileListByProcessType}" Name="foldListTreeView" Margin="0,10,0,0">
+                <TreeView.ItemContainerStyle>
+                    <Style BasedOn="{StaticResource TreeViewItemExtend}" TargetType="{x:Type TreeViewItem}">
+                        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
+                    </Style>
+                </TreeView.ItemContainerStyle>
+                <TreeView.ItemTemplate>
+                    <HierarchicalDataTemplate >
+                        <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
+                            <Image
+                                 x:Name="ExpandImage"
+                                 Width="20"
+                                 Height="20"
+                                 VerticalAlignment="Center"
+                                 Source="/MECF.Framework.UI.Client;component/Resources/Images/Folder_Close.png"/>
+                            <TextBlock Width="110" Margin="5,0,0,0" TextWrapping="Wrap" Text="{Binding Name}"/>
+                        </StackPanel>
+                    </HierarchicalDataTemplate>
+                </TreeView.ItemTemplate>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="PreviewMouseUp">
+                        <micro:ActionMessage MethodName="TreeSelectChanged">
+                            <micro:Parameter Value="{Binding SelectedItem, ElementName=foldListTreeView}"/>
+                        </micro:ActionMessage>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </TreeView>
+        </Border>
+        <Border Background="#DAE5F1" Grid.Column="1">
+
+            <ListView       x:Name="RecipeFileList" HorizontalContentAlignment="Stretch" ItemsSource="{Binding RecipeFileList,UpdateSourceTrigger=PropertyChanged}">
+                <ListView.View>
+                    <GridView>
+                        <GridView.Columns>
+
+                            <GridViewColumn Width="240"  Header="Name">
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <Border  HorizontalAlignment="Center"  Margin="-8,0,-5,0"   BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,0,0">
+                                            <TextBlock Width="240" TextWrapping="Wrap" Text="{Binding Name, Mode=TwoWay}"  HorizontalAlignment="Center"  VerticalAlignment="Center"  TextAlignment="Center"/>
+                                        </Border>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+
+                            <GridViewColumn Width="120"  Header="Owner">
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <Border  Margin="-8,0,-5,0"   BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,0,0">
+                                            <TextBlock  Text="{Binding Revisor, Mode=TwoWay}"  Width="112"   Margin="4,10,4,10" HorizontalAlignment="Center"  VerticalAlignment="Center"  TextAlignment="Center"/>
+
+                                        </Border>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+                            <GridViewColumn Width="250"  Header="Description">
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <Border  Margin="-8,0,-5,0"   BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,0,0">
+                                            <TextBlock  TextWrapping="Wrap" Text="{Binding Description, Mode=TwoWay}"  Width="250"   Margin="4,10,4,10" HorizontalAlignment="Center"  VerticalAlignment="Center"  TextAlignment="Center"/>
+
+                                        </Border>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+                            <GridViewColumn Width="200"  Header="Data">
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <Border  Margin="-8,0,-5,0"   BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,0,0">
+                                            <TextBlock  Text="{Binding ReviseTime, Mode=TwoWay}" Width="200"   Margin="4,10,4,10" HorizontalAlignment="Center"  VerticalAlignment="Center"  TextAlignment="Center"/>
+
+                                        </Border>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+                        </GridView.Columns>
+                    </GridView>
+                </ListView.View>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="PreviewMouseUp">
+                        <micro:ActionMessage MethodName="TreeSelectChanged">
+                            <micro:Parameter Value="{Binding SelectedItem, ElementName=RecipeFileList}"/>
+                        </micro:ActionMessage>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </ListView>
+
+        </Border>
+        <!--<TabControl
+            Grid.Column="1"
             Padding="0"
-            HorizontalAlignment="Stretch"
             VerticalAlignment="Stretch"
             HorizontalContentAlignment="Stretch"
             VerticalContentAlignment="Stretch"
@@ -189,9 +270,11 @@
                                     Style="{StaticResource TextBlock_Top}"
                                     Text="Owner"/>
                             </Border>
-                            <!--<Border Grid.Column="3" BorderBrush="Black"  BorderThickness="0,0,1,1">
+                            -->
+        <!--<Border Grid.Column="3" BorderBrush="Black"  BorderThickness="0,0,1,1">
                                 <TextBlock Style="{StaticResource TextBlock_Top}" Block.TextAlignment="Center"   Text="Permission" Margin="0,0,0,0"/>
                             </Border>-->
+        <!--
                             <Border
                                 Grid.Column="3"
                                 BorderBrush="Black"
@@ -212,19 +295,22 @@
                                     Style="{StaticResource TextBlock_Top}"
                                     Text="Date"/>
                             </Border>
+                            -->
+        <!--  Height="{Binding Path=ActualHeight, ElementName=PART_BORDER, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"  -->
+        <!--
                             <TreeView
                                 x:Name="RecipeTree1"
                                 Grid.Row="1"
                                 Grid.ColumnSpan="6"
                                 Height="790"
                                 Margin="0"
-                                HorizontalAlignment="Stretch"
                                 VerticalAlignment="Stretch"
                                 ItemTemplateSelector="{StaticResource FolderFileTemplateSelector}"
                                 ItemsSource="{Binding FileListByProcessType}"
                                 ScrollViewer.CanContentScroll="True"
                                 ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                                 ScrollViewer.PanningMode="VerticalOnly"
+                                ScrollViewer.VerticalScrollBarVisibility="Visible"
                                 Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=DataContext}"
                                 VirtualizingPanel.IsVirtualizing="True"
                                 VirtualizingPanel.VirtualizationMode="Recycling">
@@ -247,90 +333,104 @@
                     </ScrollViewer>
                 </DataTemplate>
             </TabControl.ContentTemplate>
+
             <i:Interaction.Triggers>
                 <i:EventTrigger EventName="SelectionChanged">
                     <micro:ActionMessage MethodName="TabSelectionChanged"/>
                 </i:EventTrigger>
             </i:Interaction.Triggers>
-        </TabControl>
-        <Grid Grid.Column="1" Margin="0,13">
+        </TabControl>-->
+
+        <Grid Grid.Column="2" Margin="0,13">
             <Grid.RowDefinitions>
                 <RowDefinition Height="0"/>
                 <RowDefinition/>
                 <RowDefinition/>
+
                 <RowDefinition/>
                 <RowDefinition/>
                 <RowDefinition/>
+
                 <RowDefinition/>
                 <RowDefinition/>
                 <RowDefinition/>
+
+                <RowDefinition/>
+                <RowDefinition/>
                 <RowDefinition/>
                 <RowDefinition/>
             </Grid.RowDefinitions>
 
-            <!--<Button
+            <Button
                 Grid.Row="0"
                 Margin="10,3"
                 Command="{Binding SelectRecipeTypeCommand}"
-                Content="Select Recipe Type"/>-->
+                Content="Select Recipe Type"
+                Visibility="Hidden"/>
             <Button
                 Grid.Row="1"
                 Margin="10,3"
                 Command="{Binding NewFolderCommand}"
-                Content="New Folder"/>
+                IsEnabled="{Binding IsEnabledFolderPermission, UpdateSourceTrigger=Default}"
+                Content="New Folder"  />
             <Button
                 Grid.Row="2"
                 Margin="10,3"
                 Command="{Binding DeleteFolderCommand}"
                 Content="Delete Folder"
-                IsEnabled="{Binding IsCurrentNodePath}"/>
+                IsEnabled="{Binding IsEnabledFolderPermission, UpdateSourceTrigger=PropertyChanged}"/>
             <Button
                 Grid.Row="3"
                 Margin="10,3"
                 Command="{Binding RenameFolderCommand}"
                 Content="Rename Folder"
-                IsEnabled="{Binding IsCurrentNodePath}"/>
+                IsEnabled="{Binding IsEnabledFolderPermission, UpdateSourceTrigger=PropertyChanged}"/>
+
             <Button
                 Grid.Row="4"
                 Margin="10,3"
                 Command="{Binding NewRecipeCommand}"
+                IsEnabled="{Binding IsEnabledNewRecipe, UpdateSourceTrigger=PropertyChanged}"
                 Content="New Recipe"/>
             <Button
                 Grid.Row="5"
                 Margin="10,3"
                 Command="{Binding DeleteRecipeCommand}"
                 Content="Delete Recipe"
-                IsEnabled="{Binding IsFreePermission}"/>
+                IsEnabled="{Binding IsSingleSelectPermission, UpdateSourceTrigger=PropertyChanged}"/>
             <Button
                 Grid.Row="6"
                 Margin="10,3"
                 Command="{Binding EditRecipeCommand}"
                 Content="Edit Recipe"
-                IsEnabled="{Binding IsReadAndWritePermission}"/>
+                IsEnabled="{Binding IsSelectPermission, UpdateSourceTrigger=PropertyChanged}"/>
             <Button
                 Grid.Row="7"
                 Margin="10,3"
                 Command="{Binding RenameRecipeCommand}"
                 Content="Rename Recipe"
-                IsEnabled="{Binding IsReadAndWritePermission}"/>
+                IsEnabled="{Binding IsSingleSelectPermission, UpdateSourceTrigger=PropertyChanged}"/>
             <Button
                 Grid.Row="8"
                 Margin="10,3"
                 Command="{Binding SaveAsRecipeCommand}"
                 Content="Copy Recipe"
-                IsEnabled="{Binding IsReadAndWritePermission}"/>
+                IsEnabled="{Binding IsSingleSelectPermission, UpdateSourceTrigger=PropertyChanged}"/>
             <Button
                 Grid.Row="9"
                 Margin="10,3"
                 Command="{Binding ViewRecipeCommand}"
                 Content="View Recipe"
-                IsEnabled="{Binding IsCurrentNodeFile}"/>
+                IsEnabled="{Binding IsSelectPermission, UpdateSourceTrigger=PropertyChanged}"/>
             <Button
                 Grid.Row="10"
                 Margin="10,3"
                 Command="{Binding ChangePermission}"
                 Content="Change Property"
                 IsEnabled="{Binding IsSelectPermission, UpdateSourceTrigger=PropertyChanged}"/>
+
+  
         </Grid>
+
     </Grid>
-</UserControl>
+</UserControl>

File diff suppressed because it is too large
+ 673 - 331
Furnace/FurnaceUI/Views/Recipes/RecipeJobViewModel.cs


+ 1 - 1
Furnace/FurnaceUI/Views/Recipes/RecipeLayoutEditView.xaml

@@ -63,7 +63,7 @@
             <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                 <TextBlock Text="File Name:" Width="80"/>
                 <Border BorderBrush="Gray" BorderThickness="1">
-                    <TextBlock Text="{Binding RecipeName}" Width="500" TextWrapping="Wrap" Background="Red"/>
+                    <TextBlock Text="{Binding RecipeName}" Width="500" TextWrapping="Wrap" />
                 </Border>
             </StackPanel>
             <Border Grid.Row="2" BorderBrush="Gray" BorderThickness="1" Padding="4">

+ 15 - 5
Furnace/FurnaceUI/Views/Recipes/RecipeLayoutEditViewModel.cs

@@ -843,14 +843,24 @@ namespace FurnaceUI.Views.Recipes
                     BoatMapWafers = recipeLayoutBoatMapViewModel.listBoatWafers.ToList();
                     CurrentRecipe = recipeLayoutBoatMapViewModel.CurrentRecipe;
 
-                    ProductNum = recipeLayoutBoatMapViewModel.ProductSlotCount;
-                    MonitorNum1 = recipeLayoutBoatMapViewModel.Monitor1SlotCount;
-                    MonitorNum2 = recipeLayoutBoatMapViewModel.Monitor2SlotCount;
+                    //ProductNum = recipeLayoutBoatMapViewModel.ProductSlotCount;
+                    //MonitorNum1 = recipeLayoutBoatMapViewModel.Monitor1SlotCount;
+                    //MonitorNum2 = recipeLayoutBoatMapViewModel.Monitor2SlotCount;
+
+                    //var data = ComputSD(BoatMapWafers);
+                    //LowerSDNum = data.Item1;
+                    //UpperSDNum = data.Item2;
 
                     var data = ComputSD(BoatMapWafers);
-                    LowerSDNum = data.Item1;
-                    UpperSDNum = data.Item2;
+                    UpperSDNum = recipeLayoutBoatMapViewModel.listBoatWafers.Where(x => x == "SD").Count();
+                    LowerSDNum = recipeLayoutBoatMapViewModel.listBoatWafers.Where(x => x == "FD").Count();
+
+                    ProductNum = recipeLayoutBoatMapViewModel.listBoatWafers.Where(x => x.StartsWith("P")).Count();
+                    MonitorNum1 = recipeLayoutBoatMapViewModel.listBoatWafers.Where(x => x == "M1").Count();
+                    MonitorNum2 = recipeLayoutBoatMapViewModel.listBoatWafers.Where(x => x == "M2").Count();
                 }
+
+
             }
         }
 

+ 125 - 29
Furnace/FurnaceUI/Views/Recipes/RecipeLayoutView.xaml

@@ -25,7 +25,6 @@
                 <TextBlock
                     Width="250"
                     Margin="5,0,0,0"
-                    Background="Red"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     FontSize="15"
@@ -55,9 +54,9 @@
                     VerticalAlignment="Center"
                     FontFamily="Segoe"
                     FontSize="15"
-                     TextWrapping="WrapWithOverflow"
                     Text="{Binding Name}"
-                    TextAlignment="Left"/>
+                    TextAlignment="Left"
+                    TextWrapping="Wrap"/>
                 <TextBlock
                     Width="100"
                     HorizontalAlignment="Center"
@@ -72,7 +71,6 @@
                     FontSize="15"
                     Text="{Binding Revisor}"
                     TextAlignment="Center"/>
-                <!--<TextBlock Width="100" Text="{Binding Permission}" FontSize="15"  VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center"/>-->
                 <TextBlock
                     Width="280"
                     HorizontalAlignment="Center"
@@ -87,7 +85,6 @@
                     FontSize="15"
                     Text="{Binding ReviseTime}"
                     TextAlignment="Center"/>
-
             </StackPanel>
         </HierarchicalDataTemplate>
         <editors:FolderOrFileTemplateSelector
@@ -99,15 +96,103 @@
     </UserControl.Resources>
     <Grid IsEnabled="{Binding IsPermission}">
         <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="220"/>
             <ColumnDefinition Width="*"/>
             <ColumnDefinition Width="200"/>
         </Grid.ColumnDefinitions>
+        <Border BorderBrush="Black" BorderThickness="1" Background="#DAE5F1">
+            <TreeView      ScrollViewer.HorizontalScrollBarVisibility="Hidden"
+  ItemsSource="{Binding ProcessTypeFileList[0].FileListByProcessType}" Name="foldListTreeView" Margin="0,10,0,0">
+                <TreeView.ItemContainerStyle>
+                    <Style BasedOn="{StaticResource TreeViewItemExtend}" TargetType="{x:Type TreeViewItem}">
+                        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
+                    </Style>
+                </TreeView.ItemContainerStyle>
+                <TreeView.ItemTemplate>
+                    <HierarchicalDataTemplate >
+                        <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
+                            <Image
+                                 x:Name="ExpandImage"
+                                 Width="20"
+                                 Height="20"
+                                 VerticalAlignment="Center"
+                                 Source="/MECF.Framework.UI.Client;component/Resources/Images/Folder_Close.png"/>
+                            <TextBlock Width="110" Margin="5,0,0,0" TextWrapping="Wrap" Text="{Binding Name}"/>
+                        </StackPanel>
+                    </HierarchicalDataTemplate>
+                </TreeView.ItemTemplate>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="PreviewMouseUp">
+                        <micro:ActionMessage MethodName="TreeSelectChanged">
+                            <micro:Parameter Value="{Binding SelectedItem, ElementName=foldListTreeView}"/>
+                        </micro:ActionMessage>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </TreeView>
+        </Border>
+        <Border Background="#DAE5F1" Grid.Column="1">
+
+            <ListView       x:Name="RecipeFileList" HorizontalContentAlignment="Stretch" ItemsSource="{Binding RecipeFileList,UpdateSourceTrigger=PropertyChanged}">
+                <ListView.View>
+                    <GridView>
+                        <GridView.Columns>
+
+                            <GridViewColumn Width="240"  Header="Name">
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <Border  HorizontalAlignment="Center"  Margin="-8,0,-5,0"   BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,0,0">
+                                            <TextBlock Width="240" TextWrapping="Wrap" Text="{Binding Name, Mode=TwoWay}"  HorizontalAlignment="Center"  VerticalAlignment="Center"  TextAlignment="Center"/>
+                                        </Border>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+
+                            <GridViewColumn Width="120"  Header="Owner">
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <Border  Margin="-8,0,-5,0"   BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,0,0">
+                                            <TextBlock  Text="{Binding Revisor, Mode=TwoWay}"  Width="112"   Margin="4,10,4,10" HorizontalAlignment="Center"  VerticalAlignment="Center"  TextAlignment="Center"/>
+
+                                        </Border>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+                            <GridViewColumn Width="250"  Header="Description">
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <Border  Margin="-8,0,-5,0"   BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,0,0">
+                                            <TextBlock  TextWrapping="Wrap" Text="{Binding Description, Mode=TwoWay}"  Width="250"   Margin="4,10,4,10" HorizontalAlignment="Center"  VerticalAlignment="Center"  TextAlignment="Center"/>
 
-        <TabControl
-            Grid.Column="0"
-            Margin="0,-1,0,-10"
+                                        </Border>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+                            <GridViewColumn Width="200"  Header="Data">
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <Border  Margin="-8,0,-5,0"   BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,0,0">
+                                            <TextBlock  Text="{Binding ReviseTime, Mode=TwoWay}" Width="200"   Margin="4,10,4,10" HorizontalAlignment="Center"  VerticalAlignment="Center"  TextAlignment="Center"/>
+
+                                        </Border>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+                        </GridView.Columns>
+                    </GridView>
+                </ListView.View>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="PreviewMouseUp">
+                        <micro:ActionMessage MethodName="TreeSelectChanged">
+                            <micro:Parameter Value="{Binding SelectedItem, ElementName=RecipeFileList}"/>
+                        </micro:ActionMessage>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </ListView>
+
+        </Border>
+        <!--<TabControl
+            Grid.Column="1"
             Padding="0"
-            HorizontalAlignment="Stretch"
             VerticalAlignment="Stretch"
             HorizontalContentAlignment="Stretch"
             VerticalContentAlignment="Stretch"
@@ -183,9 +268,11 @@
                                     Style="{StaticResource TextBlock_Top}"
                                     Text="Owner"/>
                             </Border>
-                            <!--<Border Grid.Column="3" BorderBrush="Black"  BorderThickness="0,0,1,1">
+                            -->
+        <!--<Border Grid.Column="3" BorderBrush="Black"  BorderThickness="0,0,1,1">
                                 <TextBlock Style="{StaticResource TextBlock_Top}" Block.TextAlignment="Center"   Text="Permission" Margin="0,0,0,0"/>
                             </Border>-->
+        <!--
                             <Border
                                 Grid.Column="3"
                                 BorderBrush="Black"
@@ -206,6 +293,9 @@
                                     Style="{StaticResource TextBlock_Top}"
                                     Text="Date"/>
                             </Border>
+                            -->
+        <!--  Height="{Binding Path=ActualHeight, ElementName=PART_BORDER, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"  -->
+        <!--
                             <TreeView
                                 x:Name="RecipeTree1"
                                 Grid.Row="1"
@@ -215,15 +305,17 @@
                                 VerticalAlignment="Stretch"
                                 ItemTemplateSelector="{StaticResource FolderFileTemplateSelector}"
                                 ItemsSource="{Binding FileListByProcessType}"
+                                ScrollViewer.CanContentScroll="True"
                                 ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                                 ScrollViewer.PanningMode="VerticalOnly"
-                                ScrollViewer.VerticalScrollBarVisibility="Auto"
+                                ScrollViewer.VerticalScrollBarVisibility="Visible"
                                 Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=DataContext}"
                                 VirtualizingPanel.IsVirtualizing="True"
                                 VirtualizingPanel.VirtualizationMode="Recycling">
                                 <TreeView.ItemContainerStyle>
                                     <Style BasedOn="{StaticResource TreeViewItemExtend}" TargetType="{x:Type TreeViewItem}">
-                                        <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
+                                        <Setter Property="local:BringSelectedItemIntoViewBehavior.IsBringSelectedIntoView" Value="True"/>
+                                        <Setter Property="IsExpanded" Value="True"/>
                                         <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
                                     </Style>
                                 </TreeView.ItemContainerStyle>
@@ -245,11 +337,9 @@
                     <micro:ActionMessage MethodName="TabSelectionChanged"/>
                 </i:EventTrigger>
             </i:Interaction.Triggers>
+        </TabControl>-->
 
-        </TabControl>
-
-        <Grid Grid.Column="1" Margin="0,13">
-
+        <Grid Grid.Column="2" Margin="0,13">
             <Grid.RowDefinitions>
                 <RowDefinition Height="0"/>
                 <RowDefinition/>
@@ -262,76 +352,82 @@
                 <RowDefinition/>
                 <RowDefinition/>
                 <RowDefinition/>
-                <RowDefinition/>
 
                 <RowDefinition/>
+                <RowDefinition/>
+                <RowDefinition/>
+                <RowDefinition/>
             </Grid.RowDefinitions>
 
-            <!--<Button
+            <Button
                 Grid.Row="0"
                 Margin="10,3"
                 Command="{Binding SelectRecipeTypeCommand}"
-                Content="Select Recipe Type"/>-->
-
+                Content="Select Recipe Type"
+                Visibility="Hidden"/>
             <Button
                 Grid.Row="1"
                 Margin="10,3"
                 Command="{Binding NewFolderCommand}"
-                Content="New Folder"/>
-
+                IsEnabled="{Binding IsEnabledFolderPermission, UpdateSourceTrigger=Default}"
+                Content="New Folder"  />
             <Button
                 Grid.Row="2"
                 Margin="10,3"
                 Command="{Binding DeleteFolderCommand}"
                 Content="Delete Folder"
-                IsEnabled="{Binding IsCurrentNodePath}"/>
+                IsEnabled="{Binding IsEnabledFolderPermission, UpdateSourceTrigger=PropertyChanged}"/>
             <Button
                 Grid.Row="3"
                 Margin="10,3"
                 Command="{Binding RenameFolderCommand}"
                 Content="Rename Folder"
-                IsEnabled="{Binding IsCurrentNodePath}"/>
+                IsEnabled="{Binding IsEnabledFolderPermission, UpdateSourceTrigger=PropertyChanged}"/>
+
             <Button
                 Grid.Row="4"
                 Margin="10,3"
                 Command="{Binding NewRecipeCommand}"
+                IsEnabled="{Binding IsEnabledNewRecipe, UpdateSourceTrigger=PropertyChanged}"
                 Content="New Recipe"/>
             <Button
                 Grid.Row="5"
                 Margin="10,3"
                 Command="{Binding DeleteRecipeCommand}"
                 Content="Delete Recipe"
-                IsEnabled="{Binding IsFreePermission}"/>
+                IsEnabled="{Binding IsSingleSelectPermission, UpdateSourceTrigger=PropertyChanged}"/>
             <Button
                 Grid.Row="6"
                 Margin="10,3"
                 Command="{Binding EditRecipeCommand}"
                 Content="Edit Recipe"
-                IsEnabled="{Binding IsReadAndWritePermission}"/>
+                IsEnabled="{Binding IsSelectPermission, UpdateSourceTrigger=PropertyChanged}"/>
             <Button
                 Grid.Row="7"
                 Margin="10,3"
                 Command="{Binding RenameRecipeCommand}"
                 Content="Rename Recipe"
-                IsEnabled="{Binding IsReadAndWritePermission}"/>
+                IsEnabled="{Binding IsSingleSelectPermission, UpdateSourceTrigger=PropertyChanged}"/>
             <Button
                 Grid.Row="8"
                 Margin="10,3"
                 Command="{Binding SaveAsRecipeCommand}"
                 Content="Copy Recipe"
-                IsEnabled="{Binding IsReadAndWritePermission}"/>
+                IsEnabled="{Binding IsSingleSelectPermission, UpdateSourceTrigger=PropertyChanged}"/>
             <Button
                 Grid.Row="9"
                 Margin="10,3"
                 Command="{Binding ViewRecipeCommand}"
                 Content="View Recipe"
-                IsEnabled="{Binding IsCurrentNodeFile}"/>
+                IsEnabled="{Binding IsSelectPermission, UpdateSourceTrigger=PropertyChanged}"/>
             <Button
                 Grid.Row="10"
                 Margin="10,3"
                 Command="{Binding ChangePermission}"
                 Content="Change Property"
                 IsEnabled="{Binding IsSelectPermission, UpdateSourceTrigger=PropertyChanged}"/>
+
+          
         </Grid>
 
     </Grid>

File diff suppressed because it is too large
+ 638 - 242
Furnace/FurnaceUI/Views/Recipes/RecipeLayoutViewModel.cs


+ 102 - 8
Furnace/FurnaceUI/Views/Recipes/RecipeView.xaml

@@ -96,12 +96,102 @@
     </UserControl.Resources>
     <Grid IsEnabled="{Binding IsPermission}">
         <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="220"/>
             <ColumnDefinition Width="*"/>
             <ColumnDefinition Width="200"/>
         </Grid.ColumnDefinitions>
-        <TabControl
-            Grid.Column="0"
-            Margin="0,-1,0,-10"
+        <Border BorderBrush="Black" BorderThickness="1" Background="#DAE5F1">
+            <TreeView      ScrollViewer.HorizontalScrollBarVisibility="Hidden"
+  ItemsSource="{Binding ProcessTypeFileList[0].FileListByProcessType}" Name="foldListTreeView" Margin="0,10,0,0">
+                <TreeView.ItemContainerStyle>
+                    <Style BasedOn="{StaticResource TreeViewItemExtend}" TargetType="{x:Type TreeViewItem}">
+                        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
+                    </Style>
+                </TreeView.ItemContainerStyle>
+                <TreeView.ItemTemplate>
+                    <HierarchicalDataTemplate >
+                        <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
+                            <Image
+                                 x:Name="ExpandImage"
+                                 Width="20"
+                                 Height="20"
+                                 VerticalAlignment="Center"
+                                 Source="/MECF.Framework.UI.Client;component/Resources/Images/Folder_Close.png"/>
+                            <TextBlock Width="110" Margin="5,0,0,0" TextWrapping="Wrap" Text="{Binding Name}"/>
+                        </StackPanel>
+                    </HierarchicalDataTemplate>
+                </TreeView.ItemTemplate>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="PreviewMouseUp">
+                        <micro:ActionMessage MethodName="TreeSelectChanged">
+                            <micro:Parameter Value="{Binding SelectedItem, ElementName=foldListTreeView}"/>
+                        </micro:ActionMessage>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </TreeView>
+        </Border>
+        <Border Background="#DAE5F1" Grid.Column="1">
+
+            <ListView       x:Name="RecipeFileList" HorizontalContentAlignment="Stretch" ItemsSource="{Binding RecipeFileList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
+                <ListView.View>
+                    <GridView>
+                        <GridView.Columns>
+                         
+                            <GridViewColumn Width="240"  Header="Name">
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <Border  HorizontalAlignment="Center"  Margin="-8,0,-5,0"   BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,0,0">
+                                            <TextBlock Width="240" TextWrapping="Wrap" Text="{Binding Name, Mode=TwoWay}"  HorizontalAlignment="Center"  VerticalAlignment="Center"  TextAlignment="Center"/>
+                                        </Border>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+                          
+                            <GridViewColumn Width="120"  Header="Owner">
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <Border  Margin="-8,0,-5,0"   BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,0,0">
+                                            <TextBlock  Text="{Binding Revisor, Mode=TwoWay}"  Width="112"   Margin="4,10,4,10" HorizontalAlignment="Center"  VerticalAlignment="Center"  TextAlignment="Center"/>
+
+                                        </Border>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+                            <GridViewColumn Width="250"  Header="Description">
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <Border  Margin="-8,0,-5,0"   BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,0,0">
+                                            <TextBlock  TextWrapping="Wrap" Text="{Binding Description, Mode=TwoWay}"  Width="250"   Margin="4,10,4,10" HorizontalAlignment="Center"  VerticalAlignment="Center"  TextAlignment="Center"/>
+
+                                        </Border>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+                            <GridViewColumn Width="200"  Header="Data">
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <Border  Margin="-8,0,-5,0"   BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,0,0">
+                                            <TextBlock  Text="{Binding ReviseTime, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="200"   Margin="4,10,4,10" HorizontalAlignment="Center"  VerticalAlignment="Center"  TextAlignment="Center"/>
+
+                                        </Border>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+                        </GridView.Columns>
+                    </GridView>
+                </ListView.View>
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="PreviewMouseUp">
+                        <micro:ActionMessage MethodName="TreeSelectChanged">
+                            <micro:Parameter Value="{Binding SelectedItem, ElementName=RecipeFileList}"/>
+                        </micro:ActionMessage>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </ListView>
+
+        </Border>
+        <!--<TabControl
+            Grid.Column="1"
             Padding="0"
             VerticalAlignment="Stretch"
             HorizontalContentAlignment="Stretch"
@@ -178,9 +268,11 @@
                                     Style="{StaticResource TextBlock_Top}"
                                     Text="Owner"/>
                             </Border>
-                            <!--<Border Grid.Column="3" BorderBrush="Black"  BorderThickness="0,0,1,1">
+                            -->
+        <!--<Border Grid.Column="3" BorderBrush="Black"  BorderThickness="0,0,1,1">
                                 <TextBlock Style="{StaticResource TextBlock_Top}" Block.TextAlignment="Center"   Text="Permission" Margin="0,0,0,0"/>
                             </Border>-->
+        <!--
                             <Border
                                 Grid.Column="3"
                                 BorderBrush="Black"
@@ -201,7 +293,9 @@
                                     Style="{StaticResource TextBlock_Top}"
                                     Text="Date"/>
                             </Border>
-                            <!--  Height="{Binding Path=ActualHeight, ElementName=PART_BORDER, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"  -->
+                            -->
+        <!--  Height="{Binding Path=ActualHeight, ElementName=PART_BORDER, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"  -->
+        <!--
                             <TreeView
                                 x:Name="RecipeTree1"
                                 Grid.Row="1"
@@ -243,9 +337,9 @@
                     <micro:ActionMessage MethodName="TabSelectionChanged"/>
                 </i:EventTrigger>
             </i:Interaction.Triggers>
-        </TabControl>
+        </TabControl>-->
 
-        <Grid Grid.Column="1" Margin="0,13">
+        <Grid Grid.Column="2" Margin="0,13">
             <Grid.RowDefinitions>
                 <RowDefinition Height="0"/>
                 <RowDefinition/>
@@ -275,7 +369,7 @@
                 Grid.Row="1"
                 Margin="10,3"
                 Command="{Binding NewFolderCommand}"
-                IsEnabled="{Binding IsEnabledFolderPermission, UpdateSourceTrigger=PropertyChanged}"
+                IsEnabled="{Binding IsEnabledFolderPermission, UpdateSourceTrigger=Default}"
                 Content="New Folder"  />
             <Button
                 Grid.Row="2"

+ 171 - 23
Furnace/FurnaceUI/Views/Recipes/RecipeViewModel.cs

@@ -1,4 +1,5 @@
 using Aitex.Core.RT.Log;
+using Aitex.Sorter.Common;
 using Caliburn.Micro;
 using Caliburn.Micro.Core;
 using FurnaceUI.Common;
@@ -14,6 +15,8 @@ using MECF.Framework.UI.Client.ClientBase;
 using OpenSEMI.ClientBase;
 using OpenSEMI.ClientBase.Command;
 using RecipeEditorLib.RecipeModel.Params;
+using SciChart.Charting.Common.Extensions;
+using SciChart.Core.Extensions;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -210,8 +213,20 @@ namespace FurnaceUI.Views.Recipes
                 return this._historyRecipeCommand;
             }
         }
+        private List<FileNode> _recipeFileList = new List<FileNode>();
+        public List<FileNode> RecipeFileList
+        {
+            get { return _recipeFileList; }
+            set { _recipeFileList = value; this.NotifyOfPropertyChange(nameof(RecipeFileList)); }
+        }
+
+        private List<ProcessTypeFileItem> _processTypeFileList = new List<ProcessTypeFileItem>();
+        public List<ProcessTypeFileItem> ProcessTypeFileList
+        {
+            get { return _processTypeFileList; }
+            set { _processTypeFileList = value; this.NotifyOfPropertyChange(nameof(ProcessTypeFileList)); }
+        }
 
-        public ObservableCollection<ProcessTypeFileItem> ProcessTypeFileList { get; set; } = new ObservableCollection<ProcessTypeFileItem>();
 
         public RecipeDataBase CurrentRecipe { get; private set; }
 
@@ -411,6 +426,7 @@ namespace FurnaceUI.Views.Recipes
                 // var recipes = _recipeProvider.GetXmlRecipeList(prefix);
                 type.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList(prefix);// RecipeSequenceTreeBuilder.BuildFileNode(prefix, "", false, recipes)[0].Files;
                 ProcessTypeFileList.Add(type);
+                RecipeFileList = type.FileListByProcessType.FirstOrDefault()?.Files.ToList();
             }
             //if (ProcessTypeFileList[0].FileListByProcessType.Count > 0)
             //    CurrentFileNode = ProcessTypeFileList[0].FileListByProcessType[ProcessTypeFileList[0].FileListByProcessType.Count - 1];
@@ -456,7 +472,7 @@ namespace FurnaceUI.Views.Recipes
             }
             string recipeName = fileName.Trim();
             string description = "";
-            string prefix = CurrentChamberType + "\\" + CurrentProcessType;
+            string prefix = CurrentChamberType + "\\" + CurrentProcessType + "\\" + fileName;
             if (!IsExist(recipeName.ToLower(), true))
             {
                 RecipeDataBase recipe = new RecipeDataBase();
@@ -545,6 +561,21 @@ namespace FurnaceUI.Views.Recipes
                     //  this.Save(this.CurrentRecipe, false);
                 }
             }
+            if (node != null && !node.IsFile)
+            {
+                ProcessTypeFileList[0].FileListByProcessType.ForEachDo(a =>
+                {
+                    a.IsSelected = false;
+                    if (a.Name == node.Name)
+                    {
+                        a.IsSelected = true;
+                        RecipeFileList = a.Files.ToList();
+                        return;
+                    }
+                });
+
+            }
+
             CurrentFileNode = node;
             IsFreePermission = true;
             IsReadAndWritePermission = true;
@@ -591,7 +622,7 @@ namespace FurnaceUI.Views.Recipes
                     processType = selectRecipeType;
                 }
 
-                ProcessTypeFileList = new ObservableCollection<ProcessTypeFileItem>();
+                ProcessTypeFileList = new List<ProcessTypeFileItem>();
                 string[] recipeProcessType = ((string)processType).Split(',');
 
                 for (int i = 0; i < recipeProcessType.Length; i++)
@@ -656,7 +687,7 @@ namespace FurnaceUI.Views.Recipes
                 {
                     prefix = selectNode.PrefixPath;
                     folder = selectNode.FullPath.Replace($"{prefix}\\", "");
-                    newFolder = $"{folder}\\{ name}";
+                    newFolder = $"{folder}\\{name}";
                 }
                 else
                 {
@@ -676,7 +707,19 @@ namespace FurnaceUI.Views.Recipes
                 prefix = GetPrefix(prefix, selectNode);
                 _recipeProvider.CreateRecipeFolder(prefix, name);
 
-                ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, newFolder, true);
+
+                ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == CurrentProcessType);
+                if (item == null)
+                {
+                    LOG.Write("error reload recipe file list, type = " + CurrentProcessType);
+                }
+
+                //var recipes = _recipeProvider.GetXmlRecipeList(prefix);
+                item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList($"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}");// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
+                FindSelectedFile(item.FileListByProcessType, $"{prefix}\\{newFolder}");
+                item.InvokePropertyChanged();
+                TreeSelectChanged(CurrentFileNode);
+
             }
         }
         private string GetPrefix(string prefix, FileNode CurrentFileNode)
@@ -807,7 +850,7 @@ namespace FurnaceUI.Views.Recipes
             prefix = prefix.Replace($"\\{CurrentFileNode.Name}", "");
             _recipeProvider.DeleteRecipeFolder(prefix, CurrentFileNode.Name);
 
-            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, "", false);
+            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, "", false, true);
         }
 
         public void RenameFolder()
@@ -853,7 +896,7 @@ namespace FurnaceUI.Views.Recipes
                     UIGlobalVariable.Instance.ProcessModifiedRecipe[node.FullPath] = $"Folder Rename from [{CurrentFileNode.FullPath}] to [{name}] {DateTime.Now}";
                 }
             }
-            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, newFolder, true);
+            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, name, true, true);
         }
 
         #endregion
@@ -877,6 +920,7 @@ namespace FurnaceUI.Views.Recipes
             }
 
             InputFileNameDialogViewModel dialog = new InputFileNameDialogViewModel("Input New Recipe Name", ProcessTypeFileList[0].FileListByProcessType, "");
+            dialog.SelectIndex = ProcessTypeFileList[0].FileListByProcessType.IndexOf(ProcessTypeFileList[0].FileListByProcessType.FirstOrDefault(a => a.IsSelected));
             //dialog.FileName = (string)QueryDataClient.Instance.Service.GetConfig($"System.Recipe.DefaultProcessRecipeName");
             WindowManager wm = new WindowManager();
             bool? dialogReturn = wm.ShowDialog(dialog);
@@ -906,14 +950,14 @@ namespace FurnaceUI.Views.Recipes
                     prefix = GetPrefix(CurrentFileNode.PrefixPath, CurrentFileNode);
                 }
             }
-
-            if (IsExist(recipeName.ToLower(), true))
+            if (RecipeFileList.Find(a => a.Name == recipeName.ToLower()) != null)
             {
                 DialogBox.ShowWarning($"Can not create {recipeName}, Recipe with the same name already exist.");
                 return;
             }
 
 
+
             if ((prefix + recipeName).Length > 200)
             {
                 DialogBox.ShowWarning($"Can not create folder {recipeName}, Folder name too long, should be less 200.");
@@ -954,15 +998,29 @@ namespace FurnaceUI.Views.Recipes
             string newfile = string.Empty;
             if (types.Length > 2)
             {
-                newfile = $"{ string.Join("\\", types.Skip(2))}\\{recipeName}";
+                newfile = $"{string.Join("\\", types.Skip(2))}\\{recipeName}";
             }
             else
             {
                 newfile = recipeName;
             }
 
-            ReloadRecipeFileList(types[0], types[1], newfile, false);
+            //ReloadRecipeFileList(types[0], types[1], newfile, false);
+            ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == types[1]);
+            item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList($"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}");// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
+            FindSelectedFile(item.FileListByProcessType, $"{$"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}"}\\{newfile}");
 
+            item.FileListByProcessType.ForEachDo(a =>
+            {
+                a.IsSelected = false;
+                if (a.FullPath == prefix)
+                {
+                    a.IsSelected = true;
+                    CurrentFileNode = a;
+                    RecipeFileList = a.Files.ToList();
+                    return;
+                }
+            });
         }
 
         public void NewRecipeRoot()
@@ -1027,7 +1085,7 @@ namespace FurnaceUI.Views.Recipes
             ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, recipeName, false);
         }
 
-        private void ReloadRecipeFileList(string chamberType, string processType, string selectedFile, bool selectionIsFolder)
+        private void ReloadRecipeFileList(string chamberType, string processType, string selectedFile, bool selectionIsFolder, bool isRefreshFlod = false)
         {
             ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == processType);
             if (item == null)
@@ -1039,8 +1097,10 @@ namespace FurnaceUI.Views.Recipes
             //var recipes = _recipeProvider.GetXmlRecipeList(prefix);
             item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList(prefix);// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
             FindSelectedFile(item.FileListByProcessType, $"{prefix}\\{selectedFile}");
+            if (isRefreshFlod)
+                item.InvokePropertyChanged();
+
 
-            item.InvokePropertyChanged();
         }
 
         private bool FindSelectedFile(ObservableCollection<FileNode> nodes, string selectedFile)
@@ -1053,6 +1113,7 @@ namespace FurnaceUI.Views.Recipes
                     if (recipe.FullPath == selectedFile && recipe.Files.Count == 0)
                     {
                         recipe.IsSelected = true;
+                        CurrentFileNode = recipe;
                         return true;
                     }
                     else
@@ -1074,6 +1135,7 @@ namespace FurnaceUI.Views.Recipes
                     if (filepath == selectedFile.Replace($"{recipe.PrefixPath}\\", ""))
                     {
                         recipe.IsSelected = true;
+                        CurrentFileNode = recipe;
                         return true;
                     }
                 }
@@ -1147,8 +1209,8 @@ namespace FurnaceUI.Views.Recipes
                     this.Save(this.CurrentRecipe, false);
                 }
             }
-            this.LoadData(CurrentRecipe.PrefixPath, CurrentFileNode.FullPath);
-            InputFileNameDialogViewModel dialog = new InputFileNameDialogViewModel("Input New Recipe Name", ProcessTypeFileList[0].FileListByProcessType);
+            InputFileNameDialogViewModel dialog = new InputFileNameDialogViewModel("Input New Recipe Name", ProcessTypeFileList[0].FileListByProcessType, CurrentRecipe.Description, Visibility.Hidden);
+            dialog.SelectIndex = ProcessTypeFileList[0].FileListByProcessType.IndexOf(ProcessTypeFileList[0].FileListByProcessType.FirstOrDefault(a => a.IsSelected));
             dialog.FileName = CurrentFileNode.Name;
             WindowManager wm = new WindowManager();
             bool? dialogReturn = wm.ShowDialog(dialog);
@@ -1200,7 +1262,30 @@ namespace FurnaceUI.Views.Recipes
 
             _recipeProvider.SaveAsRecipe(prefix, recipeName, CurrentRecipe.GetXmlString());
 
-            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, recipeName, false);
+
+            prefix = GetPrefix(prefix, CurrentFileNode);
+            if (selectNode.Name == prefix)
+            {
+                ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, recipeName, false);
+            }
+            else
+            {
+                ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == CurrentProcessType);
+                item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList($"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}");// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
+                FindSelectedFile(item.FileListByProcessType, $"{$"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}"}\\{recipeName}");
+
+                item.FileListByProcessType.ForEachDo(a =>
+                {
+                    a.IsSelected = false;
+                    if (a.FullPath == prefix)
+                    {
+                        a.IsSelected = true;
+                        RecipeFileList = a.Files.ToList();
+                        return;
+                    }
+                });
+
+            }
         }
 
 
@@ -1224,6 +1309,7 @@ namespace FurnaceUI.Views.Recipes
             }
 
             InputFileNameDialogViewModel dialog = new InputFileNameDialogViewModel("Input New Recipe Name", ProcessTypeFileList[0].FileListByProcessType, CurrentRecipe.Description, Visibility.Hidden);
+            dialog.SelectIndex = ProcessTypeFileList[0].FileListByProcessType.IndexOf(ProcessTypeFileList[0].FileListByProcessType.FirstOrDefault(a => a.IsSelected));
             dialog.FileName = CurrentFileNode.Name;
             WindowManager wm = new WindowManager();
             bool? dialogReturn = wm.ShowDialog(dialog);
@@ -1268,8 +1354,24 @@ namespace FurnaceUI.Views.Recipes
             }
             CurrentRecipe.Name = dialog.FileName;
             CurrentRecipe.Description = dialog.Comment;
-            // this.Save(CurrentRecipe, false);
-            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, newName, false);
+            CurrentRecipe.ReviseTime= DateTime.Now;
+            CurrentRecipe.PrefixPath= prefix;
+          this.Save(CurrentRecipe, false);
+            //ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, newName, false);
+            ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == CurrentProcessType);
+            item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList($"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}");// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
+            FindSelectedFile(item.FileListByProcessType, $"{$"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}"}\\{newName}");
+
+            item.FileListByProcessType.ForEachDo(a =>
+            {
+                a.IsSelected = false;
+                if (a.FullPath == prefix)
+                {
+                    a.IsSelected = true;
+                    RecipeFileList = a.Files.ToList();
+                    return;
+                }
+            });
         }
 
 
@@ -1309,7 +1411,22 @@ namespace FurnaceUI.Views.Recipes
             {
                 UIGlobalVariable.Instance.ProcessModifiedRecipe[CurrentFileNode.FullPath] = $"Delet Recipe from [{CurrentFileNode.FullPath}] {DateTime.Now}";
             }
-            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, "", false);
+            //ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, "", false);
+
+            ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == CurrentProcessType);
+            item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList($"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}");// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
+            FindSelectedFile(item.FileListByProcessType, $"{$"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}"}\\{""}");
+
+            item.FileListByProcessType.ForEachDo(a =>
+            {
+                a.IsSelected = false;
+                if (a.FullPath == prefixPath)
+                {
+                    a.IsSelected = true;
+                    RecipeFileList = a.Files.ToList();
+                    return;
+                }
+            });
         }
 
         public void ReloadRecipe()
@@ -1377,8 +1494,24 @@ namespace FurnaceUI.Views.Recipes
             {
                 UIGlobalVariable.Instance.ProcessModifiedRecipe[CurrentFileNode.FullPath] = $"Edit {DateTime.Now}";
                 this.editMode = EditMode.Normal;
-                ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, CurrentFileNode.FullPath, false);
+                var prefixPath = GetPrefix(CurrentFileNode.PrefixPath, CurrentFileNode);
+                ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == CurrentProcessType);
+                item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList($"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}");// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
+                FindSelectedFile(item.FileListByProcessType, $"{$"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}"}\\{CurrentFileNode.FullPath}");
+
+                item.FileListByProcessType.ForEachDo(a =>
+                {
+                    a.IsSelected = false;
+                    if (a.FullPath == prefixPath)
+                    {
+                        a.IsSelected = true;
+                        CurrentFileNode = a;
+                        RecipeFileList = a.Files.ToList();
+                        return;
+                    }
+                });
                 this.UpdateView();
+
             }
         }
         public void ViewRecipe()
@@ -1888,7 +2021,7 @@ namespace FurnaceUI.Views.Recipes
         public void SavePermission()
         {
             CurrentRecipe.Clear();
-            var prefixPath = GetPrefix(CurrentRecipe.PrefixPath, CurrentFileNode);
+            var prefixPath = GetPrefix(CurrentFileNode.PrefixPath, CurrentFileNode);
             var recipeContent = _recipeProvider.LoadRecipe(prefixPath, CurrentRecipe.Name);
             if (string.IsNullOrEmpty(recipeContent))
             {
@@ -1907,7 +2040,22 @@ namespace FurnaceUI.Views.Recipes
             CurrentRecipe.Description = dialog.RecipeComment;
             CurrentRecipe.RecipeLevel = CurrentFileNode.Level;
             this.Save(CurrentRecipe, false);
-            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, CurrentFileNode.FullPath, false);
+            //ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, CurrentFileNode.FullPath, false);
+
+            ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == CurrentProcessType);
+            item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList($"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}");// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
+            FindSelectedFile(item.FileListByProcessType, $"{$"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}"}\\{CurrentFileNode.FullPath}");
+
+            item.FileListByProcessType.ForEachDo(a =>
+            {
+                a.IsSelected = false;
+                if (a.FullPath == CurrentRecipe.PrefixPath)
+                {
+                    a.IsSelected = true;
+                    RecipeFileList = a.Files.ToList();
+                    return;
+                }
+            });
 
         }
         public bool Save(RecipeDataBase recipe, bool createNew)
@@ -2009,7 +2157,7 @@ namespace FurnaceUI.Views.Recipes
             if (CurrentFileNode == null || !CurrentFileNode.IsFile)
                 return false;
             var windowManager = IoC.Get<IWindowManager>();
-            RecipeProcessEditViewModel recipeEditViewModel = new RecipeProcessEditViewModel(CurrentRecipe.PrefixPath, CurrentFileNode.FullPath, CurrentFileNode.Permission);
+            RecipeProcessEditViewModel recipeEditViewModel = new RecipeProcessEditViewModel(CurrentFileNode.PrefixPath, CurrentFileNode.FullPath, CurrentFileNode.Permission);
             recipeEditViewModel.SetParent(Window.GetWindow((UIElement)GetView()));
             recipeEditViewModel.RecipeType = CurrentProcessType;
             this.CurrentRecipe = recipeEditViewModel.CurrentRecipe;