1 Public Class WizardPage2
2 Inherits
PageFunction(Of WizardResult
)
4 Public Sub New(ByVal WizardData
As WizardData
)
5 Me.InitializeComponent()
6 MyBase
.DataContext
= WizardData
9 Private Sub backButton_Click(ByVal sender
As Object, ByVal e
As RoutedEventArgs
)
10 MyBase
.NavigationService
.GoBack()
13 Private Sub cancelButton_Click(ByVal sender
As Object, ByVal e
As RoutedEventArgs
)
14 Me.OnReturn(New ReturnEventArgs(Of WizardResult
)(WizardResult
.Canceled
))
17 Private Sub nextButton_Click(ByVal sender
As Object, ByVal e
As RoutedEventArgs
)
18 If Me.youngRadioButton
.IsChecked
.Value
Then
19 DirectCast(MyBase
.DataContext
, WizardData
).DataItem4
= Nothing
20 Dim nextPageYoung
As New WizardPage3(DirectCast(MyBase
.DataContext
, WizardData
))
21 AddHandler nextPageYoung
.Return, New ReturnEventHandler(Of WizardResult
)(AddressOf
Me.WizardPage_Return
)
22 MyBase
.NavigationService
.Navigate(nextPageYoung
)
24 DirectCast(MyBase
.DataContext
, WizardData
).DataItem3
= Nothing
25 Dim nextPageOld
As New WizardPage4(DirectCast(MyBase
.DataContext
, WizardData
))
26 AddHandler nextPageOld
.Return, New ReturnEventHandler(Of WizardResult
)(AddressOf
Me.WizardPage_Return
)
27 MyBase
.NavigationService
.Navigate(nextPageOld
)
31 Public Sub WizardPage_Return(ByVal sender
As Object, ByVal e
As ReturnEventArgs(Of WizardResult
))