The question is simple. Let's say I have a model. I need default data to be loaded into the model on first page load. Where do I do this? I thought on performing the data load overriding the OnInit event but then the Presenter is not available by the time that event is being fired.
Any recommendations? I'm doing it by overridin开发者_开发知识库g the OnLoad method but for some reason the method is called twice, and loads the data twice as well.
You shouldn't need to override the OnLoad method, you should be attaching to the load event in the presenter. Populate the Model in the presenter in the load event. If you're overriding the built in methods you're not using the MVP framework as it's intended.
精彩评论