2

I have an application wich has some "modules" so to speak. Each user has permissions to see each module, some don't see all some see all.

I want to load XAP files and load those view models(with views) in my application.

How do I do that with Galasoft MVVM light and DeploymentCatalogService?

Reference:

http://mvvmlight.codeplex.com/

http://codebetter.com/glennblock/2010/03/08/building-hello-mef-part-iv-deploymentcatalog/

Is it even posible or am I wasting my time here? How to initialize this in the locator?

So let me explain this in this example user case:

  1. User logs in
  2. application loads XAP files depending on user permissions (users module, groups module, articles module, customers module, accounting module etc...) = ViewModel + Views
  3. user clicks on one of the modules and the ViewModel gets initiated
  4. user uses application and is happy

I currently have all view models in one silverlight project.

Rumplin
  • 2,703
  • 21
  • 45

1 Answers1

0

Check out these blogs: http://www.davidezordan.net/blog/?p=1734, http://www.davidpoll.com/2010/02/01/on-demand-loading-of-assemblies-with-silverlight-navigation-revisited-for-silverlight-4-beta/

Denis
  • 4,115
  • 1
  • 18
  • 20
  • Yes, I've been trough all those blogs, but none of them explains clearly how to load a XAP with a view model and to initiate it in the locator or some other way of using it with MVVM – Rumplin Jun 15 '11 at 12:28
  • I am under the impression that the XAP should be its own unit of work. At least that is the way I am working it for now(still learning mef too). So in the XAP you would have the views, viewmodels, services...whatever you need in order to actually run that xap as a standalone app...thats the way I am doing it anyway. – ecathell Jun 22 '11 at 16:08
  • So you don't have one central locator, what if you need some data from an another XAP in you other XAP view? For example I have in the main viewmodel a list with data I wan't to use in other XAP viewmodels – Rumplin Jun 23 '11 at 08:20