0
在WinForms应用程序中使用MVP模式我被要求编写。赦免VB.net,因为我被迫使用这个:(MVP模式在视图界面上包含什么
是新来MVP我已经有一个被动模式的实现,其中有观点&模型,只有主持人既知道
之间不存在相关性此视图的UI哪些功能应该是IVIEW接口
我应该在的iView即
Property QItems As IList(Of QItem)
Property SelectedQItem As QItem
Property QueStatus As QueStatus
Property ReportName As String
Property ScheduleName As String
Sub BuildQItems()
Sub RunQue()
Sub StopQue()
Sub CancelCurrent()
Sub PauseCurrent()
方法/措施/任务的一部分,使通话查看的表示即在WinForm实现的iView接口
class Winform
implements IView
Private Sub btnCreate_Click(sender As System.Object, e As System.EventArgs) Handles btnCreate.Click Implements IVIEW.Create
If (_presenter.CreateSchdule()) Then
MessageBox.Show("Sucessfully Created")
Close()
End If
End Sub
End Class
或者我应该保持状态
Property QItems As IList(Of QItem)
Property SelectedQItem As QItem
Property QueStatus As QueStatus
Property ReportName As String
Property ScheduleName As String
,直接打的电话给演示是在WinForm的一部分,而不是操心利用iView intreface
即
_presenter.BuildItems()
_presenter.RunQue()
你如何权衡何时做EI何时使用MVP?
因此,只需使用事件来连接视图中的功能并让演示者使用它们即可。 – HoopSnake