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
        layoutManager.Value.ShowPad(MyPad.Value);
    }
    

    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

auks
21114
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.

link

answered 20 Jan '11, 06:36

Scott%20Whitlock's gravatar image

Scott Whitlock ♦♦
696262833
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

By RSS:

Answers

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

Tags:

×3

Asked: 20 Jan '11, 01:36

Seen: 1,704 times

Last updated: 20 Jan '11, 06:36

powered by OSQA