-
Notifications
You must be signed in to change notification settings - Fork 1
/
WizardViewModelBase.vb
57 lines (55 loc) · 1.87 KB
/
WizardViewModelBase.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Imports DevExpress.Mvvm
Imports DevExpress.Mvvm.DataAnnotations
Imports DevExpress.Mvvm.Native
Imports DevExpress.Mvvm.POCO
Namespace VM_DrivenWizard.ViewModels
Public MustInherit Class WizardViewModelBase
Implements ISupportParameter, ISupportWizardCancelCommand
Protected Sub New()
End Sub
Public ReadOnly Property CanCancel() As Boolean Implements ISupportWizardCancelCommand.CanCancel
Get
Return GetCanCancel()
End Get
End Property
Private privateModel As Model
Public Overridable Property Model() As Model
Get
Return privateModel
End Get
Protected Set(ByVal value As Model)
privateModel = value
End Set
End Property
Private Property ISupportParameter_Parameter() As Object Implements ISupportParameter.Parameter
Get
Return Model
End Get
Set(ByVal value As Object)
Model = DirectCast(value, Model)
End Set
End Property
Public Sub OnCancel(ByVal e As CancelEventArgs) Implements ISupportWizardCancelCommand.OnCancel
If Me.GetService(Of IMessageBoxService)().ShowMessage("Do you want to exit the WPF feature tour?", "WPF Tour", MessageButton.YesNo, MessageIcon.Question) = MessageResult.No Then
e.Cancel = True
End If
End Sub
Protected Overridable Function GetCanCancel() As Boolean
Return True
End Function
Public Overridable Property ShowNext() As Boolean
Public Overridable Property ShowBack() As Boolean
Public Overridable Property ShowCancel() As Boolean
Public Overridable Property ShowFinish() As Boolean
Public Overridable Property AllowNext() As Boolean
Public Overridable Property AllowBack() As Boolean
Public Overridable Property AllowCancel() As Boolean
Public Overridable Property AllowFinish() As Boolean
End Class
End Namespace