2
I’m having trouble organizing the Solution of a project using the MVVM. I don’t use any MVVM framework.
I currently have the following structure:
Solution
|
--- AppView (Projeto principal onde estão as views e que é iniciado pelo App.xaml)
|
--- AppViewModel (Assembly que contém as viewmodels)
|
--- AppModel (Assembly que contém os modelos de dados - Pessoa.cs, Cliente.cs, etc...)
The references are:
AppView -> AppViewModel -> AppModel
When starting the application is presented to AppView.MainWindow. This holds the viewmodel - AppViewModel.MainWindowViewModel (in separate Assembly).
The difficulty arose when I need this viewmodel open another Window, since I can’t do it on Assembly AppViewModel, due to references.
So I’d like to know if anyone has an example of pattern MVVM with a structure in which the assemblies of view and viewmodel are distinct.
If "open window" is "navigate to window", this can be done with a navigation service implemented twice as much as @Cigano Morrison Mem suggested.
– Paulo Morgado
I recommend this guide: http://prismwindowsruntime.codeplex.com/
– Paulo Morgado