Correct place for accessing repositories in MVVM

My UWP project follows the MVVM pattern (or it least is supposed to) and I'm currently refactoring it as it suffers from the "god viewmodel" problem: the page viewmodels do basically everything and this is really hard to maintain.

Currently a typical page viewmodel does these things:

  • It handles initialization when a page is navigated to: It fetches the models from the repositories and creates viewmodels that "wrap around" the models of my business layer and exposes them to the view with properties.
  • It exposes ICommand properties that are implemented with DelegateCommand, which call methods on my page viewmodel. These methods change some stuff in the sub-viewmodels and persist the changes by calling the repositories.
  • It listens to events that are published on an EventAggregator. It might receive events like ModelChangedEvent or ModelAddedEvent, which are created by the persistence layer when a model was changed by a third party. If the page view model receives an event like this, the view model updates the correct sub-view model.

So I have this architecture:

| Page                    |
    |  binds to properties                      
    |  calls commands
   \|/                      subscribes to changes from external
| PageViewModel           | -----------------------               |
+-------------------------+                       |               |
    |   creates                                   |               |
   \|/  updates                   gets models     |               |
+-------------------------+       stores models   |               |
| ContentViewModel        |                       |               |
+-------------------------+                       |               |
    |   wraps around                              |               |
   \|/                                           \|/              |
+-------------------------+   loads     +----------------------+  |
| ContentModel            | <---------  | IContentRepository   |  |
+-------------------------+   stores    +----------------------+  |
                                                  | notifies of   |
                                                  | changes       |
                                                 \|/              |
                                        +----------------------+  |
                                        | IEventAggregator     |<-+

I want to refactor the "god-like" PageViewModels by putting the Commands into their own file and by changing how updates received from the EventAggregator are handled. But I have a few questions about this:

Let's imagine there is an AddContentCommand that is supposed to create a new ContentModel entity and immediately stores it in the database. Should AddContentCommand be injected with IContentRepository and persist the new object by calling the repository? Or should this be done on PageViewModel? How should the PageViewModel be notified of the addition? Should this be done directly by calling some method on PageViewModel from AddContentCommand or should this be done through the EventAggregator? Should AddContentCommand even have a reference to PageViewModel at all?

Would there be issues if each ContentViewModel subscribed to changes on IEventAggregator and updated itself accordingly? Or is it better if PageViewModel subscribes to it and tells the dependent view models to update, as it is done right now?