INotifyPropertyChanged implementation for VB.Net

Apr 20, 2009 at 3:38 PM
There is a syntactical difference between C# and VB.Net based interface implementations. While implementing an interface in VB we have to explicitly add the Implements clause to the function/field/Sub body.
Right now the code generated by the tool (while implementing databinding support) works fine for C# but VB.NET version gives compile time error. This is because of the fact that the generated code does not explicitly specify that the event PropertyChanged is implementing INotifyPropertyChanged.PropertyChanged.

Here is the code produced by the tool (which can't be compiled):




Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler


Private Sub OnPropertyChanged(ByVal info As String)



        RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(info))



End Sub





The problem exists with the event declaration. Code will compile if we append  "Implements INotifyPropertyChanged.PropertyChanged" with the event declaration, as following:

                Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged


Is there a way to enforce this behavior while generating code for VB.NET?

Thanks in advance.
Nov 23, 2009 at 4:28 PM

I fixed this issue with the latest Release.

Nov 23, 2009 at 4:31 PM

Whoops Latest from the Source Control not current release