using MECF.Framework.UI.Client.CenterViews.Editors.Recipe; using MECF.Framework.UI.Client.CenterViews.Editors.Sequence; using System.Collections.ObjectModel; using FurnaceUI.Client; using FurnaceUI.Models; namespace FurnaceUI.Views.Recipes { public class ProcessRecipeViewModel : FurnaceUIViewModelBase { public ObservableCollection ProcessTypeFileList { get; set; } = new ObservableCollection(); public string FilePath { get; set; } = ""; private RecipeProvider _recipeProvider = new RecipeProvider(); public ProcessRecipeViewModel() { var type = new ProcessTypeFileItem(); type.ProcessType = "Process"; var prefix = $"Furnace\\Process"; var recipes = _recipeProvider.GetXmlRecipeList(prefix); type.FileListByProcessType = RecipeSequenceTreeBuilder.BuildFileNode(prefix, "", false, recipes)[0].Files; ProcessTypeFileList.Add(type); } public void TreeSelectChanged(FileNode node) { if (node != null && node.IsFile) { FilePath = $" {node.PrefixPath}\\{node.FullPath}"; } } public void SwitchPage(string page) { switch (page) { case "RecipeEdit": ClientApp.Instance.SwitchPage("Recipe", "recipeEdit", null); break; //case "SelfCheck": // ClientApp.Instance.SwitchPage("status", "selfCheck", null); // break; //case "Gas": // ClientApp.Instance.SwitchPage("status", "gas", null); //break; } } } }