protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs e) { IIntegratedHelpService helpService = this.Context.Services.GetService <IIntegratedHelpService>(); if (helpService != null) { if ((Boolean)e.NewValue) { this.isSelectionChangedInternally = true; this.Context.Items.SetValue(new Selection()); this.isSelectionChangedInternally = false; helpService.AddContextAttribute(string.Empty, WorkflowViewManager.GetF1HelpTypeKeyword(typeof(ImportDesigner)), System.ComponentModel.Design.HelpKeywordType.F1Keyword); } else { helpService.RemoveContextAttribute(string.Empty, WorkflowViewManager.GetF1HelpTypeKeyword(typeof(ImportDesigner))); } } base.OnIsKeyboardFocusWithinChanged(e); }
ViewManager GetViewManager(ModelItem modelItem) { Fx.Assert(modelItem != null, "modelItem cannot be null"); ViewManager viewManager = null; // First we look for a ViewManagerAttribute. for example a ServiceContractRoot tag, could use // use its own view manager if it wanted to . ViewManagerAttribute viewManagerAttribute = TypeDescriptor.GetAttributes(modelItem.ItemType)[typeof(ViewManagerAttribute)] as ViewManagerAttribute; if (viewManagerAttribute != null && viewManagerAttribute.ViewManagerType != null) { viewManager = (ViewManager)Activator.CreateInstance(viewManagerAttribute.ViewManagerType); } // If no viewmanager attribute is found we default to the workflowviewmanager if (viewManager == null) { viewManager = new WorkflowViewManager(); } viewManager.Initialize(this.context); return viewManager; }