public static PresetFolderViewModel FromPresetFolder(PresetFolder folder, PresetsService passedPresetsService) { return(new PresetFolderViewModel(passedPresetsService, folder.IsExpanded, isBuiltIn: false, id: folder.Id) { Name = folder.Name, ParentId = folder.ParentId }); }
public void CreateSubFolder(PresetFolderViewModel folderViewModel) { var dialogVM = new ChooseNameViewModel(EncodingRes.ChooseNameSubfolder, new List <string>()); dialogVM.Name = EncodingRes.DefaultPresetFolderName; var windowManager = Ioc.Get <IWindowManager>(); windowManager.OpenDialog(dialogVM, windowManager.Find <EncodingWindowViewModel>()); if (dialogVM.DialogResult) { string subfolderName = dialogVM.Name; PresetFolder newFolder = PresetFolderStorage.AddFolder(subfolderName, folderViewModel.Id); folderViewModel.AddSubfolder(PresetFolderViewModel.FromPresetFolder(newFolder, this)); } }