Boman

since VB and C# do not handle namespaces the sameway ..

How would this example look like in VB
http://www.codeproject.com/WPF/HiliteListViewItemsInWPF.asp

or just how to get a converter working in VB.

/Bo



Re: Windows Presentation Foundation (WPF) C# converter in VB

Clint Rutkas

Hey Boman, Carlos Mares has a free VB.Net to C# and C# to VB.Net converter.

http://www.carlosag.net/Tools/CodeTranslator/Default.aspx

I've run into small issues when I've needed to convert, but it should get you 95% of the way there.






Re: Windows Presentation Foundation (WPF) C# converter in VB

Boman

Hi Clint ..

I was not thinking on converting syntax .. More on how to set op a converter.class to recalcuate

values ..like the one I link to. I'am a flashguy who is trying WPF , so I'am newbie in windows coding.

The VB is Firm policies Sad .. Whould rather write i C#.

But again if Anyone could help me setup a converter.class ( like the example ) it would be great.

/Bo





Re: Windows Presentation Foundation (WPF) C# converter in VB

Yi-Lun Luo - MSFT

Hello, is this what you want This is exactly output from the tool Clint pointed out.

<ValueConversion(GetType(System.Object), GetType(System.Int32))> _
Public Class NumberToPolarValueConverter
Inherits IValueConverter

Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object
Dim
number As Double = CType(System.Convert.ChangeType(value, GetType(System.Double)),Double)
If (number < 0) Then
Return
-1
End If
If
(number = 0) Then
Return
0
End If
Return
1
End Function

Public Function
ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object
Throw New
NotSupportedException("ConvertBack not supported")
End Function
End Class