diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin index 1ae58eeb1d..48262f2c2a 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin @@ -41,6 +41,7 @@ class = "ICSharpCode.FormsDesigner.Commands.AlignToGrid"/> 0) { - DropDownItems.Add(new ToolStripMenuItem()); - } } public Menu(string text, params ToolStripItem[] subItems) @@ -80,6 +77,13 @@ namespace ICSharpCode.Core if (codon != null) { ConditionFailedAction failedAction = codon.GetFailedAction(caller); this.Visible = failedAction != ConditionFailedAction.Exclude; + if (!isInitialized && failedAction != ConditionFailedAction.Exclude) { + isInitialized = true; + CreateDropDownItems(); // must be created to support shortcuts + if (DropDownItems.Count == 0 && subItems.Count > 0) { + DropDownItems.Add(new ToolStripMenuItem()); + } + } } } diff --git a/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/Gui/MenuCheckBox.cs b/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/Gui/MenuCheckBox.cs index 0b481aee67..f78e209c54 100644 --- a/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/Gui/MenuCheckBox.cs +++ b/src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/Gui/MenuCheckBox.cs @@ -80,7 +80,9 @@ namespace ICSharpCode.Core if (codon != null) { ConditionFailedAction failedAction = codon.GetFailedAction(caller); this.Visible = failedAction != ConditionFailedAction.Exclude; - Checked = MenuCommand.IsChecked; + if (MenuCommand != null) { + Checked = MenuCommand.IsChecked; + } } }