canton7 / PropertyChanged.SourceGenerator

Powerful INotifyPropertyChanged / INotifyPropertyChanging Source Generator, which generates INPC boilerplate for you as part of your build. Supports features such as automatic and manual dependencies between properties, notifications when specific properties change, and more.
MIT License
138 stars 14 forks source link

WPF incompatibility (INPC006) #32

Closed OZ1 closed 1 year ago

OZ1 commented 1 year ago

Description I get INPC006 when used inside Window derived class: warning INPC006: Found one or more methods called 'OnPropertyChanged' to raise the PropertyChanged event, but they had an unrecognised signatures or were inaccessible. No PropertyChanged events will be raised from this type warning CS0067: Событие "MainWindow.PropertyChanged" никогда не используется.

To Reproduce Create WPF project. Add any [Notify] field to MainWindow.xaml.cs. Compile.

Version Info

Additional Info class Window is derived from DependencyObject which contains protected virtual void OnPropertyChanged(DependencyPropertyChangedEventArgs e)

canton7 commented 1 year ago

It's not usual to implement INPC in your views. You've got DependencyProperties available there. If you need to do that, add your own OnPropertyChanged method which has a compatible signature.