Search code examples
c#wpfprism-6

Understanding Modules in PRISM


I just wanted to confirm my understanding of prism modules.

I my thought was a module may consist of many features with many views.

For example I want to create UserManagement module that consists of the following features which have their own main views

Features
* User Listing
* User Update
* Change Password

is my understanding of modules in prism correct? How would I tell the module manger to load which feature?

Or do I have this all wrong and each module can only have one main view?


Solution

  • is my understanding of modules in prism correct?

    Yes, a module in Prism is simply a loosely coupled functional unit in form of a class library project that typically represents a set of related concerns and includes a collection of related components, such views, view models, models and other classes.

    You would implement all functionality and UI that is related to the management of users in your application in the UserManagement module. You can read more about this on MSDN: https://msdn.microsoft.com/en-us/library/gg405479(v=pandp.40).aspx.

    How would I tell the module manger to load which feature?

    There are a bunch of code samples available on the official Prism site on GitHub: https://github.com/PrismLibrary/Prism-Samples-Wpf

    The HelloWorld sample demonstrates how to load a module: https://github.com/PrismLibrary/Prism-Samples-Wpf/blob/master/HelloWorld/HelloWorld/Bootstrapper.cs

    Or do I have this all wrong and each module can only have one main view?

    No, a single module may certainly contain more than one view.