From 4ab69bfe23f75117e29c0545822ee15fffa88953 Mon Sep 17 00:00:00 2001 From: DevExpressExampleBot Date: Mon, 1 Nov 2021 13:15:14 +0300 Subject: [PATCH 1/2] autogenerate VB --- VB/AddRemoveRows.sln | 24 ++++ VB/AddRemoveRows/AddRemoveRowBehavior.vb | 65 ++++++++++ VB/AddRemoveRows/AddRemoveRows.vbproj | 108 ++++++++++++++++ VB/AddRemoveRows/App.xaml | 9 ++ VB/AddRemoveRows/App.xaml.vb | 12 ++ VB/AddRemoveRows/MainViewModel.vb | 53 ++++++++ VB/AddRemoveRows/MainWindow.xaml | 39 ++++++ VB/AddRemoveRows/MainWindow.xaml.vb | 15 +++ VB/AddRemoveRows/Properties/AssemblyInfo.vb | 44 +++++++ .../Properties/Resources.Designer.vb | 62 ++++++++++ VB/AddRemoveRows/Properties/Resources.resx | 117 ++++++++++++++++++ .../Properties/Settings.Designer.vb | 25 ++++ VB/AddRemoveRows/Properties/Settings.settings | 7 ++ 13 files changed, 580 insertions(+) create mode 100644 VB/AddRemoveRows.sln create mode 100644 VB/AddRemoveRows/AddRemoveRowBehavior.vb create mode 100644 VB/AddRemoveRows/AddRemoveRows.vbproj create mode 100644 VB/AddRemoveRows/App.xaml create mode 100644 VB/AddRemoveRows/App.xaml.vb create mode 100644 VB/AddRemoveRows/MainViewModel.vb create mode 100644 VB/AddRemoveRows/MainWindow.xaml create mode 100644 VB/AddRemoveRows/MainWindow.xaml.vb create mode 100644 VB/AddRemoveRows/Properties/AssemblyInfo.vb create mode 100644 VB/AddRemoveRows/Properties/Resources.Designer.vb create mode 100644 VB/AddRemoveRows/Properties/Resources.resx create mode 100644 VB/AddRemoveRows/Properties/Settings.Designer.vb create mode 100644 VB/AddRemoveRows/Properties/Settings.settings diff --git a/VB/AddRemoveRows.sln b/VB/AddRemoveRows.sln new file mode 100644 index 0000000..63782e6 --- /dev/null +++ b/VB/AddRemoveRows.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "AddRemoveRows", "AddRemoveRows\AddRemoveRows.vbproj", "{4F666629-A1BE-4D1C-B533-079FB01E98C0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4F666629-A1BE-4D1C-B533-079FB01E98C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F666629-A1BE-4D1C-B533-079FB01E98C0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F666629-A1BE-4D1C-B533-079FB01E98C0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F666629-A1BE-4D1C-B533-079FB01E98C0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {67EF888A-2C22-4819-8F59-FBBA33DBA461} + EndGlobalSection +EndGlobal diff --git a/VB/AddRemoveRows/AddRemoveRowBehavior.vb b/VB/AddRemoveRows/AddRemoveRowBehavior.vb new file mode 100644 index 0000000..de4c597 --- /dev/null +++ b/VB/AddRemoveRows/AddRemoveRowBehavior.vb @@ -0,0 +1,65 @@ +Imports DevExpress.Mvvm +Imports DevExpress.Mvvm.UI.Interactivity +Imports DevExpress.Xpf.Grid +Imports System.Windows +Imports System.Windows.Input + +Namespace AddRemoveRows + + Public Class AddRemoveRowBehavior + Inherits Behavior(Of TableView) + + Public Shared AddCommandPropertyKey As DependencyPropertyKey = DependencyProperty.RegisterReadOnly(NameOf(AddRemoveRowBehavior.AddCommand), GetType(ICommand), GetType(AddRemoveRowBehavior), New PropertyMetadata(CType(Nothing, PropertyChangedCallback))) + + Public Shared AddCommandProperty As DependencyProperty + + Public Property AddCommand As ICommand + Get + Return CType(GetValue(AddCommandProperty), ICommand) + End Get + + Private Set(ByVal value As ICommand) + SetValue(AddCommandPropertyKey, value) + End Set + End Property + + Public Shared DeleteCommandPropertyKey As DependencyPropertyKey = DependencyProperty.RegisterReadOnly(NameOf(AddRemoveRowBehavior.DeleteCommand), GetType(ICommand), GetType(AddRemoveRowBehavior), New PropertyMetadata(CType(Nothing, PropertyChangedCallback))) + + Public Shared DeleteCommandProperty As DependencyProperty + + Public Property DeleteCommand As ICommand + Get + Return CType(GetValue(DeleteCommandProperty), ICommand) + End Get + + Private Set(ByVal value As ICommand) + SetValue(DeleteCommandPropertyKey, value) + End Set + End Property + + Public Sub New() + AddCommand = New DelegateCommand(AddressOf AddNewRow) + DeleteCommand = New DelegateCommand(AddressOf DeleteRow) + End Sub + + Protected Overrides Sub OnAttached() + MyBase.OnAttached() + AssociatedObject.InitNewRow += AddressOf OnInitNewRow + End Sub + + Private Sub AddNewRow() + AssociatedObject.AddNewRow() + End Sub + + Private Sub OnInitNewRow(ByVal sender As Object, ByVal e As InitNewRowEventArgs) + AssociatedObject.Grid.SetCellValue(GridControl.NewItemRowHandle, AssociatedObject.Grid.Columns("ProductName"), "New Product") + AssociatedObject.Grid.SetCellValue(GridControl.NewItemRowHandle, AssociatedObject.Grid.Columns("UnitPrice"), 10) + AssociatedObject.Grid.SetCellValue(GridControl.NewItemRowHandle, AssociatedObject.Grid.Columns("CompanyName"), "New Company") + AssociatedObject.Grid.SetCellValue(GridControl.NewItemRowHandle, AssociatedObject.Grid.Columns("Discontinued"), False) + End Sub + + Private Sub DeleteRow() + AssociatedObject.DeleteRow(AssociatedObject.FocusedRowHandle) + End Sub + End Class +End Namespace diff --git a/VB/AddRemoveRows/AddRemoveRows.vbproj b/VB/AddRemoveRows/AddRemoveRows.vbproj new file mode 100644 index 0000000..7025a59 --- /dev/null +++ b/VB/AddRemoveRows/AddRemoveRows.vbproj @@ -0,0 +1,108 @@ + + + + + On + Debug + AnyCPU + {4F666629-A1BE-4D1C-B533-079FB01E98C0} + WinExe + + + AddRemoveRows + v4.5.2 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} + 4 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG,TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + App.xaml + Code + + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.vb + AddRemoveRows.Properties + + + SettingsSingleFileGenerator + Settings.Designer.vb + + + + \ No newline at end of file diff --git a/VB/AddRemoveRows/App.xaml b/VB/AddRemoveRows/App.xaml new file mode 100644 index 0000000..d14ad8f --- /dev/null +++ b/VB/AddRemoveRows/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/VB/AddRemoveRows/App.xaml.vb b/VB/AddRemoveRows/App.xaml.vb new file mode 100644 index 0000000..41f5d61 --- /dev/null +++ b/VB/AddRemoveRows/App.xaml.vb @@ -0,0 +1,12 @@ +Imports System.Windows + +Namespace AddRemoveRows + + ''' + ''' Interaction logic for App.xaml + ''' + Public Partial Class App + Inherits Application + + End Class +End Namespace diff --git a/VB/AddRemoveRows/MainViewModel.vb b/VB/AddRemoveRows/MainViewModel.vb new file mode 100644 index 0000000..afa882d --- /dev/null +++ b/VB/AddRemoveRows/MainViewModel.vb @@ -0,0 +1,53 @@ +Imports DevExpress.Mvvm +Imports System.Collections.Generic +Imports System.Collections.ObjectModel + +Namespace AddRemoveRows + + Public Class Person + + Public Property ProductName As String + + Public Property CompanyName As String + + Public Property UnitPrice As Integer + + Public Property Discontinued As Boolean + + Public Sub New() + End Sub + + Public Sub New(ByVal i As Integer) + ProductName = "ProductName" & i + CompanyName = "CompanyName" & i + UnitPrice = i + Discontinued = i Mod 2 = 0 + End Sub + End Class + + Public Class MainViewModel + Inherits ViewModelBase + + Private Shared _Persons As ObservableCollection(Of AddRemoveRows.Person) + + Public Shared Property Persons As ObservableCollection(Of Person) + Get + Return _Persons + End Get + + Private Set(ByVal value As ObservableCollection(Of Person)) + _Persons = value + End Set + End Property + + Public Sub New() + Persons = New ObservableCollection(Of Person)(GetSource()) + End Sub + + Private Shared Iterator Function GetSource() As IEnumerable(Of Person) + For i As Integer = 0 To 9 - 1 + Yield New Person(i) + Next + End Function + End Class +End Namespace diff --git a/VB/AddRemoveRows/MainWindow.xaml b/VB/AddRemoveRows/MainWindow.xaml new file mode 100644 index 0000000..d334587 --- /dev/null +++ b/VB/AddRemoveRows/MainWindow.xaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VB/AddRemoveRows/MainWindow.xaml.vb b/VB/AddRemoveRows/MainWindow.xaml.vb new file mode 100644 index 0000000..93b910d --- /dev/null +++ b/VB/AddRemoveRows/MainWindow.xaml.vb @@ -0,0 +1,15 @@ +Imports DevExpress.Mvvm.UI.Interactivity +Imports DevExpress.Xpf.Grid +Imports System.Windows +Imports System.Windows.Controls + +Namespace AddRemoveRows + + Public Partial Class MainWindow + Inherits Window + + Public Sub New() + InitializeComponent() + End Sub + End Class +End Namespace diff --git a/VB/AddRemoveRows/Properties/AssemblyInfo.vb b/VB/AddRemoveRows/Properties/AssemblyInfo.vb new file mode 100644 index 0000000..28a65fa --- /dev/null +++ b/VB/AddRemoveRows/Properties/AssemblyInfo.vb @@ -0,0 +1,44 @@ +Imports System.Reflection +Imports System.Runtime.InteropServices +Imports System.Windows + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + + + + + + + + +' Setting ComVisible to false makes the types in this assembly not visible +' to COM components. If you need to access a type in this assembly from +' COM, set the ComVisible attribute to true on that type. + +'In order to begin building localizable applications, set +'CultureYouAreCodingWith in your .csproj file +'inside a . For example, if you are using US english +'in your source files, set the to en-US. Then uncomment +'the NeutralResourceLanguage attribute below. Update the "en-US" in +'the line below to match the UICulture setting in the project file. +'[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] +'(used if a resource is not found in the page, +' or application resource dictionaries) +'(used if a resource is not found in the page, +' app, or any theme specific resource dictionaries) + 'where theme specific resource dictionaries are located +'where the generic resource dictionary is located +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' [assembly: AssemblyVersion("1.0.*")] + + diff --git a/VB/AddRemoveRows/Properties/Resources.Designer.vb b/VB/AddRemoveRows/Properties/Resources.Designer.vb new file mode 100644 index 0000000..b48bd70 --- /dev/null +++ b/VB/AddRemoveRows/Properties/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ +Namespace AddRemoveRows.Properties + + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + ' This class was auto-generated by the StronglyTypedResourceBuilder + ' class via a tool like ResGen or Visual Studio. + ' To add or remove a member, edit your .ResX file then rerun ResGen + ' with the /str option, or rebuild your VS project. + + + + Friend Class Resources + + Private Shared resourceMan As Global.System.Resources.ResourceManager + + Private Shared resourceCulture As Global.System.Globalization.CultureInfo + + + Friend Sub New() + End Sub + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + + Friend Shared ReadOnly Property ResourceManager As Global.System.Resources.ResourceManager + Get + If(AddRemoveRows.Properties.Resources.resourceMan Is Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Resources", GetType(AddRemoveRows.Properties.Resources).Assembly) + AddRemoveRows.Properties.Resources.resourceMan = temp + End If + + Return AddRemoveRows.Properties.Resources.resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + + Friend Shared Property Culture As Global.System.Globalization.CultureInfo + Get + Return AddRemoveRows.Properties.Resources.resourceCulture + End Get + + Set(ByVal value As Global.System.Globalization.CultureInfo) + AddRemoveRows.Properties.Resources.resourceCulture = value + End Set + End Property + End Class +End Namespace diff --git a/VB/AddRemoveRows/Properties/Resources.resx b/VB/AddRemoveRows/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/VB/AddRemoveRows/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VB/AddRemoveRows/Properties/Settings.Designer.vb b/VB/AddRemoveRows/Properties/Settings.Designer.vb new file mode 100644 index 0000000..a8382ae --- /dev/null +++ b/VB/AddRemoveRows/Properties/Settings.Designer.vb @@ -0,0 +1,25 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ +Namespace AddRemoveRows.Properties + + + + Friend NotInheritable Partial Class Settings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As AddRemoveRows.Properties.Settings = CType((Global.System.Configuration.ApplicationSettingsBase.Synchronized(New AddRemoveRows.Properties.Settings())), AddRemoveRows.Properties.Settings) + + Public Shared ReadOnly Property [Default] As Settings + Get + Return AddRemoveRows.Properties.Settings.defaultInstance + End Get + End Property + End Class +End Namespace diff --git a/VB/AddRemoveRows/Properties/Settings.settings b/VB/AddRemoveRows/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/VB/AddRemoveRows/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From 9bc0328e49ec4b3d517c8962eb1d1269eb4760a4 Mon Sep 17 00:00:00 2001 From: DevExpressExampleBot Date: Mon, 1 Nov 2021 13:16:54 +0300 Subject: [PATCH 2/2] README auto update [skip ci] --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 6e7b728..12f3347 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/176968018/19.1.2%2B) [![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T830446) [![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)