-
When explicitly implementing INPC, the fact that the event is already declared is not picked up, meaning that another event is created in the generated code. I get that trying to find the event handler to create the method to call the event could be problematic (i.e. you can go through all the fields to find one that is I think it would be better to check to see if the current class (or any base class) implement INPC, and if they do, do not add the event. To create the method, you could do the above search, or have an exception, that when explicitly implementing INPC, then an appropriate method to call it must be detectable. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
public partial class SomeOtherViewModel : INotifyPropertyChanged
{
private PropertyChangedEventHandler _handler;
[Notify] private int _foo;
event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged
{
add => this._handler += value;
remove => this._handler -= value;
}
} |
Beta Was this translation helpful? Give feedback.
-
People do the darndest things... Should be fairly easy to add support for.
I support someone adding INPC to the class but leaving the SG to define the event. |
Beta Was this translation helpful? Give feedback.
-
@rsking Any other things you've spotted, before I cut a release? :) |
Beta Was this translation helpful? Give feedback.
People do the darndest things... Should be fairly easy to add support for.
I support someone adding INPC to the class but leaving the SG to define the event.