I have 2 Views and 2 Presenters as below. Currently I have an issue. I am loading a file in the MainFormPresenter. The returned fileObject (FlorObj) has some properties which will be used to update the Otherview (DesignView), but my MainFormPresenter has reference to only one view (mainFormView)
public partial class MainFormView : Form, IMainFormView
{
//Implementations
}
public MainFormPresenter(IMainFormView mainFormView, IDataModel dataModel)
{
private void OnOpenFileClicked(object sender, EventArgs e)
{
//File is read here
FlorFile FlorObj = readFile(fileName);
}
}
public partial class DesignView : IDesignView
{
//Implementations
}
public DesignPresenter(IDesignView DesignView, IDataModel dataModel)
{
//Implementations
}
Is it okie to correct my MainFormPresenter to contain reference to both views instead of IMainFormView only. In this case both MainFormPresenter and DesignPresenter will have access to DesignView. Is it correct or any issues with my code?
public MainFormPresenter(IMainFormView mainFormView, IDesignView DesignView, IDataModel dataModel)
{
private void OnOpenFileClicked(object sender, EventArgs e)
{
//File is read here
FlorFile FlorObj = readFile(fileName);
}
}
Please let me know if you need more information
Aucun commentaire:
Enregistrer un commentaire