WPF MVVM: How do ViewModels communicate with each other?

后端 未结 2 1054
我寻月下人不归
我寻月下人不归 2020-12-24 03:08

I have a View which has 2 sub views on it and a ViewModel is assigned to each view:

ViewA - ViewModelA
{ 
   ViewB - ViewModelB
   ViewC - ViewModelC
}
         


        
2条回答
  •  鱼传尺愫
    2020-12-24 03:40

    The ViewModels usually 'inherit' relationships from the Model. And it's not wrong to add a relation when it makes sense.

    It's perfectly OK for a ViewModel to have a property referring to another ViewModel.

提交回复
热议问题