|updating menu contributions from editor state [message #604510]
||Thu, 04 February 2010 19:06
| Alan Chaney
Registered: January 2010
I'm writing an image editing plug-in which has internal state which can be changed by user mouse gestures. When the internal state changes it needs to enable/disable menu contributions.|
I'm targeting 3.5 and the consensus seems to be that its best to use the 'command' framework. I found a similar post on this issue which recommended writing a 'PropertyTester' to programatically control menu contribution enablement. I've done that, but the problem is that when my state changes the menu doesn't always get updated.
I have looked at doing the whole thing with IAction contributions but that seems a bit of a retrograde step and anyway it doesn't seem a good idea to mix 'actions' and 'commands' in the same plug-in (or not??)
Anyway, my question is:
1. is there a way of programatically updating the 'enabled' state of a menu contribution handler from within my editor? Sorry if there is an obvious way but I can't seem to find it.
2. Can I trigger an event which will cause the framework to update menu contributions? This would make it use my property tester which works.
Thanks in advance
Powered by FUDForum
. Page generated in 0.01956 seconds