1. I have a Pad names "MyPad" (Dockablepane)
  2. The Run() function in Workbenck/MainMenu/ViewMenu.cs:

    public ViewMenuMyPad()
        ID = "MyPad";
        InsertRelativeToID = "ToolBars";
        Header = "MyPad";
     protected override void Run()
        EnableCondition = new AlwaysFalseCondition(); //disable the menu

    so I can disable the menuitem "MyPad" after user clicking this menuitem

The question is ... how to enable the menuitem "MyPad" again when user click hide/close/... on dockablepane "MyPad" ?

asked 20 Jan '11, 01:36

auks's gravatar image

accept rate: 0%

Instead of an AlwaysFalseCondition try setting EnableCondition to a ConcreteCondition. Then maintain a reference to the ConcreteCondition and you can toggle the condition manually. It raises an event when the condition changes.


answered 20 Jan '11, 06:36

Scott%20Whitlock's gravatar image

Scott Whitlock ♦♦
accept rate: 50%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 20 Jan '11, 01:36

Seen: 1,776 times

Last updated: 20 Jan '11, 06:36

powered by OSQA