ViewModel A calls ShowViewModel to ViewModel B. If B calls Close(this), it closes and go back to A.
Is there a way for ViewModel A know that B was closed? Something like a CallBack?
Thanks!
ViewModel A calls ShowViewModel to ViewModel B. If B calls Close(this), it closes and go back to A.
Is there a way for ViewModel A know that B was closed? Something like a CallBack?
Thanks!
One of the best methods solving viewmodel interdependencies is using a loosely coupled approch using the MessageBus/Event Aggregator pattern. Many of the popular MVVM frameworks (ReactiveUI for example) ship with an implementation for this.
As Stuart mentioned in one of the comments, on Android there is no guarantee that activity A will still be running to receive a notification via messenger. My favorite approach to solving "notification"-like problems in MvvmCross is to design activity A and activity B to use shared data access layer and communicate via persisted state. When you start analyzing your application, you may discover that activity A may not need to know that activity B completed. Instead, it can respond to the changes in the underlying data.