I am trying to develop a WPF program using MVVM design which has two controls: browser and textbox.
I want to have two ViewModels, one having the logic for the browser and another for the textbox. I've looked around everywhere but RelayCommand seems to be only used to bind commands of Views to ViewModels whereas in my code, I also need the two ViewModels to communicate with each other. For example, the mechanism I'm thinking is where the when the browser loads a web page, the browser ViewModel extracts the HTML code, and then does some processing/formatting on the code and once its done, it will assign the code to a property in the browser ViewModel and raise an event. Once this is done, the textbox ViewModel will listen to the event from the browser ViewModel (or any other ViewModels) and assign the text as the content of the textbox.
Is there anyway to achieve this or is the only way to have a parent ViewModel which contains the two child ViewModels?
Thanks