I am working on an assembly that will dynamically inject a view into a defined region inside a WPF application, and I am trying to do accomplish the following:
In the application, I would like to be able to load application data into model objects underlying the view and its viewmodel.
I would like to then save model data within the application's own data storage mechanisms.
I am concerned most with maintaining a loosely coupled design that fits the MVVM pattern. I have defined a region in my application, and the assembly has been written such that the appropriate view will be dynamically injected into that region. The problem is, as I understand it, that the view could be anything from the application's perspective. Furthermore, it doesn't seem appropriate that the application see my model or view model for the view.
Is there anything in MVVM for such a scenario? What design would be appropriate to allow the application to somehow talk to my model?
The view may also be one of many: ideally, I would like to have multiple instances of the view, each providing a view of an instance of the model. The application should ideally be able to load data into or out of selected models at any given time.
I apologize if I have not included enough in this post - I am trying to leave it general enough to avoid specifics of the project. If asked, I would be happy to clarify or give more information.
MVVM
in this website alone, you'll find 33,193 results (as of now)... I'm absolutely positive that you can find answers to all of your MVVM questions there. As such, I am voting to close this question as a duplicate. – Sheridan