diff --git a/VB/Application.xaml b/VB/Application.xaml index 7bb223b..1f2d0f5 100644 --- a/VB/Application.xaml +++ b/VB/Application.xaml @@ -1,4 +1,4 @@ - diff --git a/VB/Application.xaml.vb b/VB/Application.xaml.vb index da44dee..8da1b54 100644 --- a/VB/Application.xaml.vb +++ b/VB/Application.xaml.vb @@ -1,15 +1,15 @@ Imports System.Windows Namespace Example - Partial Public Class App - Inherits Application + Partial Public Class App + Inherits Application - Public Sub New() - AddHandler Startup, AddressOf OnStartup - End Sub - Private Overloads Sub OnStartup(ByVal sender As Object, ByVal e As StartupEventArgs) - MainWindow = New MainWindow() - MainWindow.Show() - End Sub - End Class + Public Sub New() + AddHandler Startup, AddressOf OnStartup + End Sub + Private Overloads Sub OnStartup(ByVal sender As Object, ByVal e As StartupEventArgs) + MainWindow = New MainWindow() + MainWindow.Show() + End Sub + End Class End Namespace diff --git a/VB/E5151.sln b/VB/E5151.sln index b6792af..785af56 100644 --- a/VB/E5151.sln +++ b/VB/E5151.sln @@ -1,4 +1,4 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 VisualStudioVersion = 12.0.21005.1 MinimumVisualStudioVersion = 10.0.40219.1 diff --git a/VB/ExampleDataErrorInfo.Wpf.vbproj b/VB/ExampleDataErrorInfo.Wpf.vbproj index ba55735..c5c24f5 100644 --- a/VB/ExampleDataErrorInfo.Wpf.vbproj +++ b/VB/ExampleDataErrorInfo.Wpf.vbproj @@ -1,4 +1,4 @@ - + @@ -11,7 +11,6 @@ v4.0 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} - Client obj.Wpf true On @@ -29,18 +28,45 @@ true prompt + + + + + + + + + + + + + + + + + + + False + True + E:\DXDLLS\14.2.7\DevExpress.Data.v14.2.dll False + True + E:\DXDLLS\14.2.7\DevExpress.Mvvm.v14.2.dll False + True + E:\DXDLLS\14.2.7\DevExpress.Printing.v14.2.Core.dll False + True + E:\DXDLLS\14.2.7\DevExpress.Xpf.Core.v14.2.dll @@ -57,25 +83,6 @@ - - - - - - - - - - - - - - - - - - - MSBuild:Compile @@ -111,4 +118,4 @@ - + \ No newline at end of file diff --git a/VB/MainWindow.xaml b/VB/MainWindow.xaml index 0382718..05aef93 100644 --- a/VB/MainWindow.xaml +++ b/VB/MainWindow.xaml @@ -1,4 +1,4 @@ - - Public Class MainViewModel - Private Shared Function AddPasswordCheck(ByVal builder As PropertyMetadataBuilder(Of MainViewModel, String)) As PropertyMetadataBuilder(Of MainViewModel, String) - Return builder.MatchesInstanceRule(Function(name, vm) vm.Password = vm.ConfirmPassword, Function() "The passwords don't match.").MinLength(8, Function() "The password must be at least 8 characters long.").MaxLength(20, Function() "The password must not exceed the length of 20.") - End Function - Public Shared Sub BuildMetadata(ByVal builder As MetadataBuilder(Of MainViewModel)) - builder.Property(Function(x) x.FirstName).Required(Function() "Please enter the first name.") - builder.Property(Function(x) x.LastName).Required(Function() "Please enter the last name.") - builder.Property(Function(x) x.Email).EmailAddressDataType(Function() "Please enter a correct email address.") - AddPasswordCheck(builder.Property(Function(x) x.Password)).Required(Function() "Please enter the password.") - AddPasswordCheck(builder.Property(Function(x) x.ConfirmPassword)).Required(Function() "Please confirm the password.") - End Sub - Public Overridable Property FirstName() As String - Public Overridable Property LastName() As String - Public Overridable Property Email() As String - Public Overridable Property Password() As String - Public Overridable Property ConfirmPassword() As String - Public Sub OnPasswordChanged() - Me.RaisePropertyChanged(Of String)(Function(d) d.ConfirmPassword) - End Sub - Public Sub OnConfirmPasswordChanged() - Me.RaisePropertyChanged(Of String)(Function(d) d.Password) - End Sub - End Class + + Public Class MainViewModel + Private Shared Function AddPasswordCheck(ByVal builder As PropertyMetadataBuilder(Of MainViewModel, String)) As PropertyMetadataBuilder(Of MainViewModel, String) + Return builder.MatchesInstanceRule(Function(name, vm) vm.Password = vm.ConfirmPassword, Function() "The passwords don't match.").MinLength(8, Function() "The password must be at least 8 characters long.").MaxLength(20, Function() "The password must not exceed the length of 20.") + End Function + Public Shared Sub BuildMetadata(ByVal builder As MetadataBuilder(Of MainViewModel)) + builder.Property(Function(x) x.FirstName).Required(Function() "Please enter the first name.") + builder.Property(Function(x) x.LastName).Required(Function() "Please enter the last name.") + builder.Property(Function(x) x.Email).EmailAddressDataType(Function() "Please enter a correct email address.") + AddPasswordCheck(builder.Property(Function(x) x.Password)).Required(Function() "Please enter the password.") + AddPasswordCheck(builder.Property(Function(x) x.ConfirmPassword)).Required(Function() "Please confirm the password.") + End Sub + Public Overridable Property FirstName() As String + Public Overridable Property LastName() As String + Public Overridable Property Email() As String + Public Overridable Property Password() As String + Public Overridable Property ConfirmPassword() As String + Public Sub OnPasswordChanged() + Me.RaisePropertyChanged(Of MainViewModel, String)(Function(d) d.ConfirmPassword) + End Sub + Public Sub OnConfirmPasswordChanged() + Me.RaisePropertyChanged(Of MainViewModel, String)(Function(d) d.Password) + End Sub + End Class End Namespace \ No newline at end of file diff --git a/VB/app.config b/VB/app.config index a6d5f33..e2a5a18 100644 --- a/VB/app.config +++ b/VB/app.config @@ -1,3 +1,3 @@ - +