Convert this little code to VB

2 posts, 0 answers
  1. fausto usme
    fausto usme avatar
    2 posts
    Member since:
    Nov 2009

    Posted 12 Nov 2009 Link to this post

    I so sorry,

    i send the complete code:


    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

     

    {

     

    public static IList<ValidationError> GetErrors(DependencyObject obj)

     

    {

     

    return (IList<ValidationError>)obj.GetValue(ErrorsProperty);

     

    }

     

    public static void SetErrors(DependencyObject obj, IList<ValidationError> value)

     

    {

    obj.SetValue(ErrorsProperty, value);

    }

     

    // 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<ValidationError>), typeof(ValidationScope), new PropertyMetadata(null, ErrorsChanged));

     

     

    public static void ErrorsChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)

     

    {

     

    FrameworkElement element = (FrameworkElement)obj;

     

    element.BindingValidationError +=

    delegate(object sender, ValidationErrorEventArgs e)

     

    {

     

    if (e.Action == ValidationErrorEventAction.Added)

     

    {

    GetErrors(obj).Add(e.Error);

    }

     

    else

     

    {

    GetErrors(obj).Remove(e.Error);

    }

    };

    }

    }


    Thanks a lot,

    Fausto

  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 12 Nov 2009 Link to this post

    Hi fausto,

    I already answered your other thread and for your convenience and for others who might be interested in it I pasted my reply below:

    We ahve implemented a converter between C# and VB and it can be used online thorugh the following yrl:

    http://www.codechanger.com/

    Please, covert your code there and test it whether it works OK for you. I also recommend to bookmark the tool so that you will be able to use it when needed.

    I hope that the provided information and resource are helpful, let us know if you have any questions or in case you need further assistance.


    Greetings,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top