In my WPF MVVM application I use dependency injection container. When I want to retrieve some data from my Model, I use an asynchronous interface to query the Model and fill the ObservableCollection in my ViewModel (I understood it thanks to the answers to my previous question).
I'm looking for a best solution to handle a following situation. There is a collection of objects I'm retrieving asynchronously from my Model. I want to use the same data to build observable collections in two different ViewModels, as I want to display that data in two different windows. The Model domain objects are going to be wrapped in different ViewModel objects as the wrappers needs to prepare the domain objects to be displayed. I don't want to retrieve data from the Model separately in each ViewModel, but to do it once, as it might be a time-consuming operation.
I've seen a few examples and everywhere a single ViewModel is responsible for retrieving data from the Model service. What should I do to use the once retrieved data in more than one ViewModel?
I think that I should introduce another layer of abstraction between my Model and ViewModels that will handle the caching of retrieved data and every ViewModel that wishes to utilize this data will have the dependency to this layer.
Is this a good idea?