質問

I have developed a simple Windows Forms application, which uses the MVC pattern as far as I can tell. I have done it successfully, but it raises a question: What if the model changes, can you think how we might notify a view/controller of this event?

What can we use instead of a Model? Is using delegates an answer?

役に立ちましたか?

解決

For tracking changes inside a Model, you can implement INotifyPropertyChanged interface in that Model class. Then any change in the Model instance will be reflected in the binded instance. For example, if you bind the IBindingList of that model to a DataGridView, then the gridview will be automatically updated on any change of that model.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top