0

I have to create now a multi-screen Silverlight 4 RIA application with MVVM.

Each of these screens has to be devided in multiple regions (for example master-detail scenario whereas each of them is a different section and one has control on the other).

Can you give me some ideas what should be the right way to implement such an application?
Is Prism the right choice? I started reading the Prism manual and liked very much the idea of having regions and screens switched and controls in a very flexible manner, but, as said above, I find it too overkill to split it all over many assemblies.

If Prism IS the right choice, then I would appreciate any kind of guidance or reference to guidance on this particular scenario (multiple screens & regions and OTOH not getting my solution spotted with a gazillion projects.

Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632

1 Answers1

1

I believe that PRISM is the correct choice for building an application with multiple regions and views. You could argue that that is almost the definition of a composite application.

But I would also remember that you don't have to use all the components PRISM has, you can pick and choose. I would recommend that you consider each aspect of PRISM and test/prototype to ensure you are happy with the facilties offered. In a large application I have built I use PRISM but after some prototype investigations I only used EventAggregator and the Modularity capabilities.

I chose not to use the region support as I found working with ItemControl and ContentControl components in Silverlight gave me the ability to inject views and partial views into my interface.

I found experience from ASP.NET MVC proved useful in considering how to coordinate/break up my UI into partial views.

Hope that helps. The Stocktrader application is a great example to learn from (included with the PRISM distributable).

Rus
  • 1,827
  • 1
  • 21
  • 32
  • @Rus, thanks for your response. The StockTrader application uses the regions spread up in different assemblies, I want to have it all in one assembly (i.e. I want at least all the ViewModels in one assembly). – Shimmy Weitzhandler Mar 05 '11 at 19:32
  • @Shimmy, you could use the region approach in StockTrader but have all your views and viewModels in a single project/namespace/assembly if you wanted. The Stocktrader application is trying to illustrate as much of PRISM as it can but you can take what you want and use your own approaches. – Rus Mar 05 '11 at 19:39
  • @Rus, The thing is I want to switch many screens to look entirely different, isn't that replacing `Shell`s? how is that done? Can you refer me to a good article on this aspect, i.e. embedding views and maintaining the screens workflow? – Shimmy Weitzhandler Mar 07 '11 at 01:20
  • @Shimmy, You asked a couple of questions, I'll attempt each one separately. What I have done is have a single Shell which can present different workspaces. Workspaces can then present subview differently as required. For maintaining workflow I tend to have a common viewModel that coordinates the different views in the workflow. – Rus Mar 07 '11 at 09:54
  • @Rus, that's what I wanted to hear, please be more specific on what you call "workspaces". – Shimmy Weitzhandler Mar 07 '11 at 11:10
  • @Shimmy, my workspaces are usercontrols with some visuals and ContentControls for holders where I can inject in whatever view I want, typically I also have a viewModel for the views I inject so that the workspace is just interested in coordination of other views (trying to be good relative to the single responsibility principal). – Rus Mar 07 '11 at 13:53