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