Hi!

We are currently developing a WinForms application using the MVP patten (passive view). A few questions have appeared and we have different views on how to solve these...

1) When should the form data be loaded? Should the view signal with an event that "ok im initialized, go ahead and load me" to the presenter? Or should we just load the data in the presenter constructor, which is what we do now? The presenter holds an instance to the view, and loads data to the view by calling methods such as

m_View.LoadWidgets(byval widgets as List(of Widget))

The view then load the UI controls in that method.


2) How should we handle async methods? For example, if the presenter has an async method for LoadWidgets that calls the wcf service m_Service.LoadWidgetsAsync(), we have a problem, since this load method is initialized iin the constructor, and that is not allowed to be async. Therefor, we imagined it would be better to let the view "signal" that it is ready for data loading. The problem then, is to find the right place to signal that, since that method also has to be async and return task or void.

Thanks for the assistance
Henrik