Cannot generate property without inherit from ObservableObject #327
-
I tried to use to source generator together with my MVVM library TinyMvvm, it has a base class for view models that are implementing INotifyPropertyChanged. I got the error below. If I add the attributes I get an error that INotifyPropertyChanged already is implemented. Is it a way around this or can't I use a base class that already implements INotifyPropertyChanged?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Unfortunately no, this is not allowed by design. You have to either inherit from |
Beta Was this translation helpful? Give feedback.
Unfortunately no, this is not allowed by design. You have to either inherit from
ObservableObject
or use one of those attributes, as either will cause some additional helper methods to be generated, which the code for[ObservableProperty]
needs. Maybe you could refactor your code to add eg. that attribute over your base viewmodel type, or something like that? 🙂