Overview
The [INotifyPropertyChanged] and [ObservableObject] are meant to support cases where inheriting isn't possible, but it seems this point is easy to spot for a lot of folks, who just use these attributes instead of the base types. We should consider adding an analyzer to flag those cases and emit a warning. Specifically, these cases should produce a warning:
[INotifyPropertyChanged] on a type that doesn't have a base class.
[ObservableObject] on a type that doesn't have a base class.
Usage example
The following should produce a warning:
[ObservableObject]
public partial class MyViewModel
{
}
Overview
The
[INotifyPropertyChanged]and[ObservableObject]are meant to support cases where inheriting isn't possible, but it seems this point is easy to spot for a lot of folks, who just use these attributes instead of the base types. We should consider adding an analyzer to flag those cases and emit a warning. Specifically, these cases should produce a warning:[INotifyPropertyChanged]on a type that doesn't have a base class.[ObservableObject]on a type that doesn't have a base class.Usage example
The following should produce a warning: