This tutorial explains different way of communication between ViewModels.
Sending an instance of one VM to another VM in MVVM C#
题
I'm complicating my own life here. I'm trying to send an instance of one VM to another VM.
I have successfully sent objects to new VM before, such as Lists or variables. But I am getting confused with sending an instance of the VM.
For example, I have AViewModel.cs
I want to do my work in the VM, so some methods are done. Then at the end, I want to send this VM to BViewModel.cs
I would usaully go: BViewModel bview = new BViewModel(aview)
Can someone please tell me where I would define the instance of A?
If there are any other questions or a need for more info, please comment and I will edit.
解决方案
不隶属于 StackOverflow