I'm trying to understand MVP pattern in c# winforms.
My question is do I have to create presenter class for each entity? For, example: In my Application I have:
- Form1, in that form
Students
will list on a Listbox - Form2, in that form
Orders
will list on a Listbox - Form3, in that form
Details
will list on a Listbox
So in my Presenter application do I have to create?:
StudentPresenter.cs
OrderPresenter.cs
DetailsPresenter.cs
If yes, suppose I have a button in my Form1
, when I click that button I want to show Form2
. Is my code below true?
private void showForm2_Click(object sender, EventArgs e)
{
var orderForm= new Form2();
var orderRepo= new OrderRepository();
var orderPresenter = new OrderPresenter(orderForm, orderRepo);
//How I show Form2 ?
}