I am creating a Prism 4 application and would like to have have each of the modules provide a set of commands/events that it can handle. I would like to register these events with the shell so that they can be rendered by the shell with the appropriate UI elements (such as menus, toolbars, ribbon elements etc.) and fired accordingly.
For example,
Lets say I have a Member module that provides functionality such as “Add New Member”, “Remove Member”, “Search Member” etc. I might also have an Investment Module that provides functionality such as “Create Investment”, “Modify Investment” etc.
Each of the modules will obviously provide the implementations for their relevant functionality. They will also provide the list of such functionalities.
Ideally, the Shell would aggregate these high level commands somehow and display them visually however it chooses. Lets say as menu items for example. So if the user clicks on the “Member” -> “Search Member” menu item, the appropriate command/event would be raised and would be routed to the appropriate module/method.
Currently I am unsure how the modules would register these said commands/events along with any UI hints such as friendly names with the shell. The reference implementation and the commanding quickstarts aren’t really much help for this particular pattern.
Thanks in advance
Yes Prism does’t really give you any guidance on this. But what I’ve seen so far is that the way to go is to create a menu service.
Your interface might look like this:
Then in the module Initialize method you would register all available commands / menu items.