In my opinion, which approach you should follow will depend mostly of your personal preferences, the requirements of your scenario and the functionality of the "Objects" you mention.
As an example, suppose that the aforementioned objects are defined like this:
- Object A: A view showing a list of clients and actions to interact with the list (ordering, filtering, reloading, etc.)
- Object B: A view that shows information of a specific client and that is contained in the
Object A's client list (one Object B for each client.)
If the Object B must only show some information about the client,
Object B could be simply an ItemTemplate for the
Object A's ItemsControl (the client list) and the
Source of that ItemControl would simply be a collection of client models. In this case, due to the "simplicity" of the
Object B, there was no need to define a separate view and view model for each client.
On the other hand, if the Object B will also provide the user with options like modifying the client's data or more complex operations, it seems reasonable to define
Object B as a separate view with its own view model to contain the data and handle such operations. In this case, the
Object A's client list could be a scoped region where the
Object B views or view models could be injected. The Object A's view model or an specific controller for the
Object A could then inject the required instances of Object B in the scoped region.
Object B could also contain scoped regions and so on...
Regarding how to retrieve an specific Object B, you could take benefit for the different communication approaches provided with
Prism as explained in the following chapter of the documentation:
Also, you can find more information about scoped regions and
scoped region managers in the following chapter of the Prism documentation:
As a side note regarding the use of scoped regions and
scoped region managers, I believe you might find the
RegionManagerAwareBehavior and the IRegionManagerAware
interface described in the following blog post interesting:
I hope you find this useful,