Пример #1
0
 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));
 }
Пример #2
0
 public RestApiViewModel(RestStudioViewModel mainViewModel, RestApiModel rest)
 {
     // Inicializa las propiedades
     MainViewModel = mainViewModel;
     if (rest == null)
     {
         Rest = new RestApiModel();
     }
     else
     {
         Rest = rest;
     }
     // Inicializa el ViewModel
     InitViewModel();
 }
Пример #3
0
 public MethodViewModel(RestStudioViewModel mainViewModel, MethodModel method)
 {
     // Inicializa las propiedades
     MainViewModel = mainViewModel;
     if (method == null)
     {
         Method = new MethodModel();
     }
     else
     {
         Method = method;
     }
     // Inicializa el ViewModel
     InitViewModel();
 }
Пример #4
0
 public ContextViewModel(RestStudioViewModel mainViewModel, ContextModel context)
 {
     // Inicializa las propiedades
     MainViewModel = mainViewModel;
     if (context == null)
     {
         Context = new ContextModel();
     }
     else
     {
         Context = context;
     }
     // Inicializa el ViewModel
     InitViewModel();
 }