public PluginsStudioViewModel(Controllers.IPluginsStudioController pluginsStudioController) { // Asigna las propiedades PluginsStudioController = pluginsStudioController; // Inicializa los objetos principales LastFilesViewModel = new Tools.LastFiles.LastFilesListViewModel(this); WorkspacesViewModel = new Tools.Workspaces.WorkspaceListViewModel(this); LogViewModel = new Tools.Log.LogListViewModel(this); SearchFilesViewModel = new Tools.Search.SearchFilesViewModel(this); TreeFoldersViewModel = new Explorers.Files.TreeFilesViewModel(this); // Asigna los comandos SaveCommand = new BaseCommand(_ => Save(false), _ => CanSave()) .AddListener(this, nameof(SelectedDetailsViewModel)); SaveAsCommand = new BaseCommand(_ => Save(true), _ => CanSave()) .AddListener(this, nameof(SelectedDetailsViewModel)); SaveAllCommand = new BaseCommand(_ => SaveAll(), _ => CanSave()) .AddListener(this, nameof(SelectedDetailsViewModel)); RefreshCommand = new BaseCommand(_ => Refresh()); }
public TreeSearchFilesResultViewModel(SearchFilesViewModel searchFilesViewModel) { SearchFilesViewModel = searchFilesViewModel; OpenCommand = new BaseCommand(_ => OpenFile(), _ => SelectedNode != null) .AddListener(this, nameof(SelectedNode)); }