Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VB/Application.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Application x:Class="Example.App"
<Application x:Class="Example.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
Expand Down
20 changes: 10 additions & 10 deletions VB/Application.xaml.vb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion VB/E5151.sln
Original file line number Diff line number Diff line change
@@ -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
Expand Down
51 changes: 29 additions & 22 deletions VB/ExampleDataErrorInfo.Wpf.vbproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand All @@ -11,7 +11,6 @@
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<BaseIntermediateOutputPath>obj.Wpf</BaseIntermediateOutputPath>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<OptionExplicit>On</OptionExplicit>
Expand All @@ -29,18 +28,45 @@
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Collections" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Data" />
<Import Include="System.Windows.Controls" />
<Import Include="System.Windows.Data" />
<Import Include="System.Windows.Shapes" />
<Import Include="System.Windows.Documents" />
<Import Include="System.Windows.Input" />
<Import Include="System.Windows.Media.Imaging" />
<Import Include="System.Windows.Media" />
<Import Include="System.Windows.Navigation" />
<Import Include="System.Windows" />
<Import Include="System" />
</ItemGroup>
<ItemGroup>
<Reference Include="DevExpress.Data.v14.2, Version=14.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
<HintPath>E:\DXDLLS\14.2.7\DevExpress.Data.v14.2.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Mvvm.v14.2, Version=14.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
<HintPath>E:\DXDLLS\14.2.7\DevExpress.Mvvm.v14.2.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Printing.v14.2.Core, Version=14.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
<HintPath>E:\DXDLLS\14.2.7\DevExpress.Printing.v14.2.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Xpf.Core.v14.2, Version=14.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
<HintPath>E:\DXDLLS\14.2.7\DevExpress.Xpf.Core.v14.2.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
Expand All @@ -57,25 +83,6 @@
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Collections" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Data" />
<Import Include="System.Windows.Controls" />
<Import Include="System.Windows.Data" />
<Import Include="System.Windows.Shapes" />
<Import Include="System.Windows.Documents" />
<Import Include="System.Windows.Input" />
<Import Include="System.Windows.Media.Imaging" />
<Import Include="System.Windows.Media" />
<Import Include="System.Windows.Navigation" />
<Import Include="System.Windows" />
<Import Include="System" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="Application.xaml">
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -111,4 +118,4 @@
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion VB/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Window x:Class="Example.MainWindow"
<Window x:Class="Example.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:View="clr-namespace:Example.View"
Expand Down
12 changes: 6 additions & 6 deletions VB/MainWindow.xaml.vb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Imports System.Windows

Namespace Example
Partial Public Class MainWindow
Inherits Window
Partial Public Class MainWindow
Inherits Window

Public Sub New()
InitializeComponent()
End Sub
End Class
Public Sub New()
InitializeComponent()
End Sub
End Class
End Namespace
2 changes: 1 addition & 1 deletion VB/View/MainView.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<UserControl x:Class="Example.View.MainView"
<UserControl x:Class="Example.View.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Expand Down
12 changes: 6 additions & 6 deletions VB/View/MainView.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
Imports System.Windows.Controls

Namespace Example.View
Partial Public Class MainView
Inherits UserControl
Partial Public Class MainView
Inherits UserControl

Public Sub New()
InitializeComponent()
End Sub
End Class
Public Sub New()
InitializeComponent()
End Sub
End Class
End Namespace
52 changes: 27 additions & 25 deletions VB/ViewModel/MainViewModel.vb
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
Imports DevExpress.Mvvm.DataAnnotations
Imports DevExpress.Mvvm
Imports DevExpress.Mvvm.DataAnnotations
Imports DevExpress.Mvvm.POCO
Imports System.Windows.Media

Namespace Example.ViewModel
<POCOViewModel(ImplementIDataErrorInfo:=True)>
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
<POCOViewModel(ImplementIDataErrorInfo := True)>
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
2 changes: 1 addition & 1 deletion VB/app.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup></configuration>