protected override void BeforeQueryStatus(OleMenuCommand command, SelectedItems selection) { base.BeforeQueryStatus(command, selection); if (command.Visible) { var selectedItem = selection.Item(1); if (selectedItem.ProjectItem != null && VsxHelper.IsPhysicalFile(selectedItem.ProjectItem) && !ContextDependentNavigationCommand.IsFeatureFile(selectedItem.ProjectItem)) { command.Visible = false; //only show it in feature file, folder or project nodes } } }