Membership in Prism

Topics: Prism v2 - WPF 3.5
May 20, 2010 at 7:50 AM
Edited May 20, 2010 at 7:52 AM


We would like to add the membership function into our prism application. It will enable the user to login/logout, configure which module the user will have access to.

Do we have an example for that?

We are currently using the view injections to load all the modules when the applciation starts.

Shall we create the memberhsip as a seperate module? Is it possible to load the modules/views dynamiclly into the shell after the user login through this seperate module?



May 28, 2010 at 9:38 PM


It is possible to load modules or place views in the shell dynamically after the user has logged in. I would recommend creating a separate login module to manage this, and making that module decide whether the other ones are going to be loaded or not (as explained on this thread).

On logout, you can have your login module publish an event through the EventAggregator, so that each module (which should be subscribed to that event) removes their views, services, and so forth. Take into account that when you login after having logged out once, you will probably have to indicate the modules that they have to load their components back.

I hope you find this useful.

Guido Leandro Maliandi