Query on MVVM pattern in WPF?

2019-06-13 16:03发布

I am implementing a MVVM pattern in my WPF application.

My application main window is divided into four parts:

  1. Main Menu On the Top
  2. Outlook Navigation Control on the Left.
  3. A List View on the Middle.
  4. Another List view on the bottom.

The Navigation control shows different setting (configuration) controls in the Tab items.

All the four above are user controls which are placed in the main window.

And corresponding to each user control there is separate view model which is bounded with a view model in the XAML of each control, however the model class remain the same between all the view model.

And a MainWindow has a seperate View Model which is also bounded with a view model in the XAML of each control.

Please help me out in framing a design in which each view models of all the controls above will interact with each other.

Please let me know if my question is not clear to you!!

2条回答
该账号已被封号
2楼-- · 2019-06-13 16:40

You might have a look at the sample projects of the WPF Application Framework.

查看更多
Summer. ? 凉城
3楼-- · 2019-06-13 16:56

Ideally your changes to the model should trigger the changes to the ViewModels. If I understand your question correctly you shouldn't need the ViewModels to interact directly with each other and might already have been answered here:

MVVM - what is the ideal way for usercontrols to talk to each other

查看更多
登录 后发表回答