'How to call method in ViewModel from another ViewModel?
In my ViewModelOne I need to call a method from ViewModelTwo. How can I do that and is it a good practice?
Solution 1:[1]
In clean code and MVVM structure(common way), Actually in a ViewModel, You don't have access to another ViewModel. You can use SharedViewModel to communicate via view(Fragment).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Yousef Kazemi |
