2
votes

From following guides on prism and reading the manual it seems the general process is to create a module with views, viewmodels and models. Then hook the view up with the viewmodel and use the view model to interact with the model.

However I have a model data structure that needs to be used across multiple different modules. Say, this model is called Car. And I have 3 modules, ModuleA, ModuleB and ModuleC that all need to use Car. If it was just used in ModuleA I would obviously put it in the Model folder of ModuleA. But as it is used in several modules, where do I put Car?

2

2 Answers

2
votes

Just put it in a seperate assembly that gets referenced by all other assemblies needing it. It's not because you're using Prism, that suddenly the good practice rules have changed. If you want to, you can use MEF or Unity to export instances (or a single shared instance) of Car. Or take it even further and declare an interface ICar and make your modules use that instead of Car directly.

2
votes

You can put it in the Infrastructure project (which is referenced by all modules) or create a shared library project that you will reference in all modules.