tags:

views:

463

answers:

1

I'm very new to Composite WPF and I'm struggling with the basic architecture of the shell.

Assume I have a Shell with three regions - 'OutlookStyleNav', 'Main' and 'Toolbar'.

How do I add buttons to the toolbar region?

Should each module add it's own button(s) to this region? (and if so, how to display all modules' buttons at the same time?)

Should the Shell dynamically detect Commands in my Controllers and create buttons based on that?

I'm not sure. Any suggestions?

+1  A: 

In our current project the modules publish all the available toolbar and menu actions and the toolbar subscribes to these "ActionAvailable" events. The events carry a delegate (which has to be called when the toolbar button is pressed), an action description (= tooltip text), an icon etc.

This way neither the shell has a direct dependency on the modules nor the modules have a dependency on the shell.

Markus Dulghier
Good advice. I went a slightly different route... I built a ShellController (and obviously an IShellController interface). The interface gets injected into the modules. The modules then register their toolbar buttons using an IShellController.RegisterToolbar(ICommand command) command. Not as loosely coupled as your implementation though.
willem

related questions