I work with a WPF application and use my own architecture, which is very similar to MV-VM / MVC. I have controllers for each of the views, and I have ViewModels related to the views.
For example, I have a ToolBarView with the corresponding ToolBarViewModel and ToolBar Controller.
I use notifications to update all views, so they don’t need to refer to each other, but this does not apply to my question.
Each view listens for an event to trigger in its controller when the model is updated. In ToolBarView, it looks like this.
Controller.Updated += UpdateView
private void Updateview(object sender,EventArgs e)
{
DataContext = Controller.Model;
}
, , , , "", UpdateView ( EventArgs e).
, , , UpdateView() , , DataContext - .Model.
, DataContext , .
, , UpdateView(), .
- , DataContext, ?