My WPF application follows the MVVM pattern. There are three views:
- MainWindow
- LoginView
- ProjectsView
LoginView
and ProjectsView
are user controls imported by the MainWindow
. Both views have their view model assigned. LoginViewModel
defines a property ProjectList
which is set by calling a webservice. Now LoginViewModel
needs access to the ProjectList
property and others.
I am aware that one solution might be a redesign so that there is only one view and one view model. I would do that as a backup solution but I would favor not to do so.
How should this be done? Should I use some kind of EventAggregator like in Prism? Or are there other ways to do this?
ProjectViewModel
shall readProjectList
fromLoginViewModel
. However it might occur that something similar needs read and write access during further development. – Adolfoadolph