public GuidanceWorkflowViewModel(GuidanceWorkflowContext context, IServiceProvider serviceProvider)
        {
            Guard.NotNull(() => context, context);
            Guard.NotNull(() => serviceProvider, serviceProvider);

            this.context = context;
            this.serviceProvider = serviceProvider;
            this.Extension = context.Extension;
            Current = this;
        }
        public GuidanceWorkflowViewModel(GuidanceWorkflowContext context, IServiceProvider serviceProvider)
        {
            Guard.NotNull(() => context, context);
            Guard.NotNull(() => serviceProvider, serviceProvider);

            this.context         = context;
            this.serviceProvider = serviceProvider;
            this.Extension       = context.Extension;
            Current = this;
        }
Example #3
0
        public GuidanceExplorerViewModel(GuidanceWorkflowContext context, IServiceProvider serviceProvider)
        {
            Guard.NotNull(() => context, context);
            Guard.NotNull(() => serviceProvider, serviceProvider);

            this.context         = context;
            this.serviceProvider = serviceProvider;
            this.guidanceManager = context.GuidanceManager;
            this.Workflows       = new ObservableCollection <GuidanceWorkflowViewModel>();
            this.SubscribeToExtensionChanges(guidanceManager);
            this.InitializeCommands();
        }
        public GuidanceExplorerViewModel(GuidanceWorkflowContext context, IServiceProvider serviceProvider)
        {
            Guard.NotNull(() => context, context);
            Guard.NotNull(() => serviceProvider, serviceProvider);

            this.context = context;
            this.serviceProvider = serviceProvider;
            this.guidanceManager = context.GuidanceManager;
            this.Workflows = new ObservableCollection<GuidanceWorkflowViewModel>();
            this.SubscribeToExtensionChanges(guidanceManager);
            this.InitializeCommands();
        }
        protected override void Initialize()
        {
            base.Initialize();

            var componentModel = this.GetService<SComponentModel, IComponentModel>();
            componentModel.DefaultCompositionService.SatisfyImportsOnce(this);

            this.trackSelection = this.GetService<SVsTrackSelectionEx, IVsTrackSelectionEx>();
            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(this.trackSelection.OnSelectChange(this.selectionContainer));

            var context = new GuidanceWorkflowContext
            {
                GuidanceManager = this.GuidanceManager,
                Extension = this.GuidanceManager.ActiveGuidanceExtension,
                UserMessageService = this.UserMessageService,
            };

            this.viewModel = new GuidanceExplorerViewModel(context, this.ServiceProvider);
            this.Content = new GuidanceExplorerView { DataContext = this.viewModel };
        }