7
Answers

Somebody to convert code from C# to VB

fausto usme

fausto usme

15y
3.4k
1
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
Answers (7)