Somebody to convert code from C# to VB
Hello, someboy who helpe to convert this code.
Really i don´t know about VB.
Thanks a lot in advanced.
Fausto
Imports System
Imports System.Net
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Documents
Imports System.Windows.Ink
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Animation
Imports System.Windows.Shapes
Imports System.Collections.Generic
Public Class ValidationScope
'' Using a DependencyProperty as the backing store for Errors. This enables animation, styling, binding, etc...
Public Shared ReadOnly ErrorsProperty As DependencyProperty = DependencyProperty.RegisterAttached("Errors", GetType(IList(Of ValidationError)), GetType(ValidationScope), New PropertyMetadata(Nothing, ErrorsChanged))
Public Shared Function GetErrors(ByVal obj As DependencyObject) As IList(Of ValidationError)
Return CType(obj.GetValue(ErrorsProperty), IList(Of ValidationError))
End Function
Public Shared Sub SetErrors(ByVal obj As DependencyObject, ByVal value As IList(Of ValidationError))
obj.SetValue(ErrorsProperty, value)
End Sub
Public Shared Sub ErrorsChanged(ByVal obj As DependencyObject, ByVal args As DependencyPropertyChangedEventArgs)
Dim element As FrameworkElement = DirectCast(obj, FrameworkElement)
element.BindingValidationError += Function(sender As Object, e As ValidationErrorEventArgs) Do
If e.Action = ValidationErrorEventAction.Added Then
GetErrors(obj).Add(e.[Error])
Else
GetErrors(obj).Remove(e.[Error])
End If
End Sub
End Class

Purushottam RathoreRank #120 · 18.2K reputationPosted Nov 13, 2009, 2:10 AM EST
Please downlode C# to vb converter and try to convert your code. this link will helpful for you
http://www.tangiblesoftwaresolutions.com/Demo.htm
Kirtan PatelRank #292 · 8.6K reputationPosted Nov 12, 2009, 1:08 PM EST
Here is Converted Code
please dont forget to mark "Do you like this answer check box" if my answer helps you :)
using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Collections.Generic; public class ValidationScope { //Using a DependencyProperty as the backing store for Errors. This enables animation, styling, binding, etc... public static readonly DependencyProperty ErrorsProperty = DependencyProperty.RegisterAttached("Errors", typeof(IList), typeof(ValidationScope), new PropertyMetadata(null, ErrorsChanged)); public static IList GetErrors(DependencyObject obj) { return (IList)obj.GetValue(ErrorsProperty); } public static void SetErrors(DependencyObject obj, IList value) { obj.SetValue(ErrorsProperty, value); } public static void ErrorsChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) { FrameworkElement element = (FrameworkElement)obj; element.BindingValidationError += (object sender, ValidationErrorEventArgs e) => ; if (e.Action == ValidationErrorEventAction.Added) { GetErrors(obj).Add(e.Error); } else { GetErrors(obj).Remove(e.Error); } } }Mahesh ChandRank #1 · 393.3K reputationPosted Nov 12, 2009, 3:38 PM EST
http://www.kamalpatel.net/ConvertCSharp2VB.aspx
fausto usme130 reputationPosted Nov 12, 2009, 4:52 PM EST
I was a mistake, because i wanted convert from c# to Vb.
I did it, but the problem is that it doesn´t compile in VB.
Please, review it.
Thanks a lot,
fausto.
fausto usme130 reputationPosted Nov 13, 2009, 3:26 AM EST
keshav singhRank #3,113 · 460 reputationPosted Nov 15, 2009, 7:21 PM EST
http://www.developerfusion.com/tools/convert/csharp-to-vb/
this may helps you
Lalit MRank #1,186 · 1.5K reputationPosted Nov 15, 2009, 7:50 PM EST