How to create an application (Gtk / Winforms) with an MVP template with nested hosts? I can’t get it right.
Suppose I have a main window (application shell) with a tree view (navigator presenter) and a panel (profile presenter) and you want each of these 3 to be separate MVP components?
public class ApplicationShellPresenter(IApplicationShellView shell);
public class NavigatorPresenter(INavigatorView navigator);
public class ProfilePresenter(IProfileView profile);
The first presenter is simple, because I can create the main window in the root of the composition and paste in the constructor, and the other two, who creates them? Views are already created in the main window. From what I see, I have two possibilities: the application shell creates them or I view the views through ApplicationShellPresenter and create them somewhere else.
And to make it even more complex, how can I use the IoC container in all of this to allow presenters, submissions?
Is my problem an injection constructor? Should I introduce Init methods instead of creating presenters without their respective representations?
Any thoughts on this would be appreciated.
source
share