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 LogListItemViewModel(LogListViewModel listViewModel, string type, string content, DateTime createdAt, BauMvvm.ViewModels.Media.MvvmColor color) : base(content, null, false, color) { // Asigna las propiedades ListViewModel = listViewModel; Type = type; Content = content; if (content.Length > 200) { Text = content.Substring(0, 200); } else { Text = content; } if (!string.IsNullOrWhiteSpace(Text)) { Text = Text.Replace("\r\n", " "); Text = Text.Replace("\r", " "); Text = Text.Replace("\n", " "); } CreatedAt = createdAt; // Asigna los comandos ShowDetailsCommand = new BauMvvm.ViewModels.BaseCommand(_ => ShowDetails()); }