We are working with the MVP pattern, and I was wondering how to deal with GUI actions.
For instance, when the user wants to delete a row from a grid, the user presses the delete button. At this point you can do two things:
1) Call _presenter.DeleteRow()
and the presenter then calls _view.SelectedRow
. Then the presenter calls view.AskUserForConfirmation()
, and when it gets back DialogResult.OK
, the presenter actually deletes the underlying object and refreshes the grid.
2) The form asks the user for confirmation and when the DialogResult
is OK
, then presenter.Delete(myObject)
is called OR presenter.Delete()
is called and within the Delete
method the object is retrieved by calling _view.SelectedRow
.
How do you handle these kinds of situations?