mardi 28 mai 2019

MVP in windows forms

I want to implement MVPO pattern in my windows forms application. As you know there is 1:1 means there is one presenter for one view.

So basicly we can have:

public class MainPresenter
{
       IMyView _myView;
       public MainPresenter(IMyView myView)
       {
             _myView = myView;
       }
}

My question is can one presenter use other presenter so for instance:

public class MainPresenter
{
       IMyView _myView;
       ISomeOtherPresenter _otherPresenter;
       public MainPresenter(IMyView myView, IOtherPresenter otherPresenter)
       {
             _myView = myView;
             _otherPresenter = otherPresenter;
       }
}

As a reference i went through video tutorial by Robert Marquez. At his 10 video serie at 10th one he used one rpesenter inside other one

Reference link

at 35:39 you will see his MainPresenter has dependency to IHelpAboutPresenter.

Aucun commentaire:

Enregistrer un commentaire