Update
I do not think that I was clear enough when I originally posted this question.
Take a look at these screenshots.
( Link to a large screenshot here )
Pay attention to the parts that I put in red. The class shown here executes INotifyPropertyChanged , but the VB compiler seems to believe that the PropertyChanged event declared does not match the INotifyPropertyChanged.PropertyChanged signature.
( Link to a large screenshot here )
Here I selected a line of code violation. Between this and the next screenshot, I literally just cut and pasted the same line back into the file (i.e. I pressed Ctrl + X and then Ctrl + V ).
( Link to a large screenshot here )
Now here! After cutting and pasting the line back, the error disappears.
What's going on here?
Original question
This happens to me sometimes, especially with the INotifyPropertyChanged interface in my experience, but I have no idea if the problem is limited to this single interface (which would seem strange) or not.
Say I have code like this. There is an interface with a single event. The class implements this interface. It includes an event.
Public Interface INotifyPropertyChanged Event PropertyChanged As PropertyChangedEventHandler End Interface Public Class Person Implements INotifyPropertyChanged Public Event PropertyChanged _ (ByVal sender As Object, ByVal e As PropertyChangedEventArgs) _ Implements INotifyPropertyChanged.PropertyChanged ' more code below ' End Class
From time to time, when I build my project, the compiler will suddenly begin to act, like the previous code. It will report that the Person class does not implement INotifyPropertyChanged because it does not have a PropertyChanged event; or he will say that the PropertyChanged event cannot implement INotifyPropertyChanged.PropertyChanged because their signatures do not match.
This is pretty weird, but the weirdest part is here: if I just cut the line starting with Event PropertyChanged and then paste it back in, the error disappears. The project is building.
Does anyone know what can be done here?