private GkeStepViewModel(GkeStepContent content) { _content = content; Clusters = new AsyncPropertyValue <IList <Cluster> >(GetAllClustersAsync()); CreateClusterCommand = new ProtectedCommand(OnCreateClusterCommand); RefreshClustersListCommand = new ProtectedCommand(OnRefreshClustersListCommand); }
/// <summary> /// Creates a GKE step complete with behavior and visuals. /// </summary> internal static GkeStepViewModel CreateStep() { var content = new GkeStepContent(); var viewModel = new GkeStepViewModel(content); content.DataContext = viewModel; return(viewModel); }
/// <summary> /// Creates a GKE step complete with behavior and visuals. /// </summary> internal static GkeStepViewModel CreateStep(IGkeDataSource dataSource = null, IApiManager apiManager = null) { var content = new GkeStepContent(); var viewModel = new GkeStepViewModel(content, dataSource, apiManager); content.DataContext = viewModel; return(viewModel); }
private GkeStepViewModel(GkeStepContent content, IGkeDataSource dataSource, IApiManager apiManager) : base(apiManager) { _content = content; _dataSource = dataSource; CreateClusterCommand = new ProtectedCommand(OnCreateClusterCommand, canExecuteCommand: false); RefreshClustersListCommand = new ProtectedCommand(OnRefreshClustersListCommand, canExecuteCommand: false); EnableApiCommand = new ProtectedAsyncCommand(OnEnableApiCommandAsync); }