Modular Application Scenario...

Topics: Prism v4 - WPF 4
Jun 21, 2011 at 3:51 PM

Hi,

I've been working with WPF for a while, and have a solid grip on the MVVM best practice.  I have an application that I think is a perfect fit for Prism, but would like to get a little direction so that I'm not spinning my wheels on an approach that won't work.  Here's the basics:

  • The WPF application will be used to configure 'run profiles' for a service-type application
  • The WPF application that will contain a primary view with some basic service configuration settings
  • The service application has various 'connectors' that will also need to be configured.  These connectors will be dynamic and available per licensing.  The connectors will have views that would be loaded dynamically into the shell/primary view.
  • Perfect world scenario would be that on startup, the application would read some sort of configuration (sql, config file, etc...) and load the appropriate connector views

I realize this isn't much detail, but you can see the direction I'm going.  I've looked through the documentation and quick starts, but wasn't sure if there was a good example or just some basic pointers for an approach.  I hope this question doesn't make me sound lazy, I'm not asking someone to write it for me, just maybe say, look for this (MEF?), and here's a few things to watch out for.

Thanks!

Gary

 

 

Jun 21, 2011 at 9:47 PM

Hi Gary,

Based on my understanding of the scenario you need to achieve, a good starting point will be to check out the QuickStarts and the Reference Implementations provided with Prism.

These solutions will help you figure out what features will suite better in your application. In my opinion, concepts like Modular development, Regions and Navigation are good candidates to help you achieve the expected scenario.

I hope this information helps you.

Thanks,

Miguel Bronzovic
http://blogs.southworks.net/mbronzovic

 

Jun 22, 2011 at 12:07 AM

Thank you, Miguel, that's just what I was looking for.  I also found a series of videos by Mike Taulty, and watched the first five.  Those really gave me a better understanding of the landscape.  What I'm going to do is incorporate PRISM into my back end first, as that will get my hands dirty with an implementation, without having to initially deal with the user interface.  I'll probably be posting more questions in the future, and thanks again for the help!

Gary

Jun 30, 2011 at 6:37 PM
Edited Jun 30, 2011 at 6:40 PM

I've got the Prism (with Unity) infrastructure up and running, but not really doing much yet.  My followup question is a little more specific:

Once everything is loaded, I'd like my 'engine' to be able to iterate through the available 'connectors', which are defined as modules, and run each one.  What I'm not sure how to do, though, is determine the connectors that are loaded.  I'm using the configuration file as the catalog for available modules/connectors.  I know there is an event for the module manager that can be captured each time a module is initialized... could that help in some way?  I'd really like this to be as dynamic as possible, and not break any basic rules of how this sort of thing should be done.

I hope what I'm asking makes sense.  Any insight would be great.

Thanks!

Gary

Jul 1, 2011 at 2:43 PM

Hi Gary,

Based on my understanding of your scenario, you could track when your modules has been loaded by subscribing the ModuleManager’s LoadModuleCompleted event. In the event handler you can implement the logic to inform the applications which modules are loaded and available.

You can find more information in Prism MSDN documentation here.

Additionally, you can check the Modularity QuickStart for WPF using Unity where these concepts are explained.

I hope you find this information useful.

Thanks,

Miguel Bronzovic
http://blogs.southworks.net/mbronzovic