the best way to approach this type of class structuring
In my opinion, the most important measure for "the best way" is to choose a way that means your app works.
The example you've looked at - sphero ball control - has examples both of independent view models (home, gangnam, about, sphero, etc), and it has an example of some view models that know about each other - the sphero view model and it's sub view models.
In this particular case, the reason those view models all know about each other is because they are all part of a single display - they are designed to sit together inside a single grid, pivot, or tabbed UI. To assist with them cooperating I've given them references to each other via IParent and IChild interfaces.
isn't this a deviation of the decoupled viewmodels that mvvm recommends?
I admit this does mean that the design isn't perfectly decoupled, and that if I need to move or reuse those child vm's in the future, then I might need to do a little code refactoring - but right now the design works well for me, and I personally am happy do that refactoring in the future if I need to.
My biggest concern now is to decide how should I organize my viewmodels in order to share data between them and at the same time to follow the mvvm guidance
If you are building a composite (tabbed) view and you're not happy using aggregated view models (like the sphero vm and it's subviews), then please don't.
I'm sure the same effect could have been achieved in sphero using one big view model, using multiple view models communicating via a messenger or using multiple view models communicating via one or more custom services.
For the particular example you give - of a configuration and main view, I don't think this fits the tabbed scenario - and I would probably code this using a messenger - that would provide me with a flexible mechanism for broadcasting and receiving change notifications around various parts of the app.
However, other designs are definitely available and viable - eg you could easily just ask the view model to refresh its configuration each time its shown (doing this would require hooking into onnavigatedto, viewwillapear and on resume calls in the views).
In summary:
- I agree with your general goal of writing independent view models and making them communicate via services.
- in the case of a main page and a settings page, I probably would use 2 separate vm's and a messenger
- In the case of tabbed/pivot UIs I personally have broken away from that perfect paradigm - but there's nothing in mvx that forces you to follow me