public TreeRestApiViewModel(RestStudioViewModel mainViewModel) { // Asigna las propiedades MainViewModel = mainViewModel; // Asigna los comandos NewRestApiCommand = new BaseCommand(_ => UpdateRestApi(null)) .AddListener(this, nameof(SelectedNode)); NewContextCommand = new BaseCommand(_ => UpdateContext(SelectedNode as NodeRestViewModel), _ => CanExecuteAction(nameof(NewContextCommand))) .AddListener(this, nameof(SelectedNode)); NewMethodCommand = new BaseCommand(_ => UpdateMethod(SelectedNode as NodeRestViewModel), _ => CanExecuteAction(nameof(NewMethodCommand))) .AddListener(this, nameof(SelectedNode)); }
public RestApiViewModel(RestStudioViewModel mainViewModel, RestApiModel rest) { // Inicializa las propiedades MainViewModel = mainViewModel; if (rest == null) { Rest = new RestApiModel(); } else { Rest = rest; } // Inicializa el ViewModel InitViewModel(); }
public MethodViewModel(RestStudioViewModel mainViewModel, MethodModel method) { // Inicializa las propiedades MainViewModel = mainViewModel; if (method == null) { Method = new MethodModel(); } else { Method = method; } // Inicializa el ViewModel InitViewModel(); }
public ContextViewModel(RestStudioViewModel mainViewModel, ContextModel context) { // Inicializa las propiedades MainViewModel = mainViewModel; if (context == null) { Context = new ContextModel(); } else { Context = context; } // Inicializa el ViewModel InitViewModel(); }