I build an application that the user have to login in order to continue.
The user that has been connected, assigned into CurrentAccountProperty in the current ViewModel.
Now, How do I make this current connected account accessible to all the other ViewModels that have interaction with it and its data?
For example, ViewModels that manipulate its login details, ViewModels, for example, that add somthing to its RecentActivities property and so on..
Should I hold a reference to the current account? somthing like CurrentAccount in each ViewModel that uses this object?
Thanks.
Well I usually
Export(MEF) property I set after user is logged in.Then I
Importeverywhere I need access to logged user.Of course you can use any IoC container as well. And you should use some kind of IoC when you talk about MVVM.