public override void Initialize(IComponent component) { base.Initialize(component); if (Control is SettingsTree) { designerHost = GetService(typeof(IDesignerHost)) as IDesignerHost; menuService = GetService(typeof(IMenuCommandService)) as IMenuCommandService; selectionService = GetService(typeof(ISelectionService)) as ISelectionService; settingsTree = Control as SettingsTree; settingsTree.TreeView.AfterSelect += OnNodeSelect; } }