Answer the question
In order to leave comments, you need to log in
How to handle events between Presenters?
I use the MVP pattern in the project. There is one form with several UserControls that have their own Presenters. Now I need to establish a connection between them. At the choice of the head of the department (UserControl with its Presenter), it is necessary to withdraw employees. When selecting employees (as in the previous case), you need to display data in another UserControl. Moreover, there is a separate control Filters, which is associated with both table controls. For this form, there is also a Presenter, which stores links to control presenters. The question arises: How to establish their interaction?
Answer the question
In order to leave comments, you need to log in
I would use IoC containers and inject services into Presenter via constructor parameters. I would put all the logic of work into the services, and the Presenter should take data from the services and upload it to the UI. If you set the correct lifetime for services, everything will fly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question