Inheritance: Tanzu.Toolkit.ViewModels.TreeViewItemViewModel
        public CfInstanceViewModel(CloudFoundryInstance cloudFoundryInstance, TasExplorerViewModel parentTasExplorer, IServiceProvider services, bool expanded = false)
            : base(null, parentTasExplorer, services, expanded: expanded)
        {
            _dialogService       = services.GetRequiredService <IErrorDialog>();
            CloudFoundryInstance = cloudFoundryInstance;
            DisplayText          = CloudFoundryInstance.InstanceName;

            LoadingPlaceholder = new PlaceholderViewModel(parent: this, services)
            {
                DisplayText = _loadingMsg,
            };

            EmptyPlaceholder = new PlaceholderViewModel(parent: this, Services)
            {
                DisplayText = _emptyOrgsPlaceholderMsg,
            };
        }
        public SpaceViewModel(CloudFoundrySpace space, OrgViewModel parentOrgViewModel, TasExplorerViewModel parentTasExplorer, IServiceProvider services, bool expanded = false)
            : base(parentOrgViewModel, parentTasExplorer, services, expanded: expanded)
        {
            _dialogService = services.GetRequiredService <IErrorDialog>();
            Space          = space;
            DisplayText    = Space.SpaceName;

            LoadingPlaceholder = new PlaceholderViewModel(parent: this, services)
            {
                DisplayText = LoadingMsg,
            };

            EmptyPlaceholder = new PlaceholderViewModel(parent: this, Services)
            {
                DisplayText = EmptyAppsPlaceholderMsg,
            };
        }
        public OrgViewModel(CloudFoundryOrganization org, CfInstanceViewModel parentCfInstanceViewModel, TasExplorerViewModel parentTasExplorer, IServiceProvider services, bool expanded = false)
            : base(parentCfInstanceViewModel, parentTasExplorer, services, expanded: expanded)
        {
            _dialogService = services.GetRequiredService <IErrorDialog>();

            Org         = org;
            DisplayText = Org.OrgName;

            LoadingPlaceholder = new PlaceholderViewModel(parent: this, services)
            {
                DisplayText = _loadingMsg,
            };

            EmptyPlaceholder = new PlaceholderViewModel(parent: this, Services)
            {
                DisplayText = _emptySpacesPlaceholderMsg,
            };
        }
示例#4
0
        protected TreeViewItemViewModel(TreeViewItemViewModel parent, TasExplorerViewModel parentTasExplorer, IServiceProvider services, bool childless = false, bool expanded = false)
            : base(services)
        {
            _parent     = parent;
            _isExpanded = expanded;
            _isLoading  = false;

            _threadingService = services.GetRequiredService <IThreadingService>();

            if (!childless) // only create placeholder & assign children if this vm isn't a placeholder itself
            {
                LoadingPlaceholder = new PlaceholderViewModel(parent: this, services)
                {
                    DisplayText = _defaultLoadingMsg,
                };

                _children = new ObservableCollection <TreeViewItemViewModel>
                {
                    LoadingPlaceholder,
                };
            }

            ParentTasExplorer = parentTasExplorer;
        }