Browse Source

Recipe list 按照修改时间倒叙排列

jiangjy 1 month ago
parent
commit
bb6a68b54b

+ 1 - 1
Furnace/FurnaceUI/Views/Recipes/RecipeJobViewModel.cs

@@ -196,7 +196,7 @@ namespace FurnaceUI.Views.Recipes
         private List<FileNode> _recipeFileList = new List<FileNode>();
         public List<FileNode> RecipeFileList
         {
-            get { return _recipeFileList; }
+            get { return _recipeFileList != null ? _recipeFileList.OrderByDescending(a => a.ReviseTime).ToList() : _recipeFileList; }
             set { _recipeFileList = value; this.NotifyOfPropertyChange(nameof(RecipeFileList)); }
         }
 

+ 1 - 1
Furnace/FurnaceUI/Views/Recipes/RecipeLayoutViewModel.cs

@@ -187,7 +187,7 @@ namespace FurnaceUI.Views.Recipes
         private List<FileNode> _recipeFileList = new List<FileNode>();
         public List<FileNode> RecipeFileList
         {
-            get { return _recipeFileList; }
+            get { return _recipeFileList != null ? _recipeFileList.OrderByDescending(a => a.ReviseTime).ToList() : _recipeFileList; }
             set { _recipeFileList = value; this.NotifyOfPropertyChange(nameof(RecipeFileList)); }
         }
 

+ 3 - 3
Furnace/FurnaceUI/Views/Recipes/RecipeViewModel.cs

@@ -217,7 +217,7 @@ namespace FurnaceUI.Views.Recipes
         private List<FileNode> _recipeFileList = new List<FileNode>();
         public List<FileNode> RecipeFileList
         {
-            get { return _recipeFileList; }
+            get { return _recipeFileList != null ? _recipeFileList.OrderByDescending(a => a.ReviseTime).ToList(): _recipeFileList; }
             set { _recipeFileList = value; this.NotifyOfPropertyChange(nameof(RecipeFileList)); }
         }
 
@@ -975,7 +975,7 @@ namespace FurnaceUI.Views.Recipes
             string recipeName = dialog.FileName.Trim();
             string filepath = dialog.FilePath;
             string description = dialog.Comment;
-         
+
 
             string prefix;
             if (filepath.Contains("\\"))
@@ -1469,7 +1469,7 @@ namespace FurnaceUI.Views.Recipes
                     return;
                 }
             });
-            CurrentFileNode=null;
+            CurrentFileNode = null;
         }
 
         public void ReloadRecipe()