I am quite new to C# / WPF, however this is what I used for this project.
Let me introduce the context : I have an application which allows a user to login. I have some basic information data (physical location) and some dynamic information (user name…). I dealed with all of that with a singleton manager.
This basic application is used with two different projects : after login, the application has to display xaml pages for the current running project.
Some configuration enum allows me to instanciate the right object from the right project assembly through a generic interface ( I guess I should have use WCF… we’ll see that later on 🙂 ).
Now I need some of the information, dealed by the singleton manager, in the project assembly. How can I do ?
I can’t share the singleton… Should i write a common db ? Or get rid of the singleton ? I am a bit lost. This is certainly simple architecture problem, but I can’t figure it out.
Thanks a lot for your help !
I suggest you use MEF for importing and exporting information from different DLL’s. Each DLL could have resources (like XAML files) for view providing. So, my choice is MVVM + MEF modularity + Prism EventAggregator for interaction beetwen modules.
Some samples, for concept demonstration only:
Kind of ‘singleton manager’:
Module (DLL for separate project) implementation
View as embeded resource (View.xaml) on each DLL.