`[INotifyPropertyChanged]` is not supported on records
Describe the bug
When applied to record (class) types, the [INotifyPropertyChanged] attribute has no effect.
Regression
No response
Steps to reproduce
[INotifyPropertyChanged]
partial record Record()
{
[ObservableProperty]
private int x;
}
Expected behavior
The PropertyChanged event and the OnPropertyChanged method are generated.
Screenshots
No response
IDE and version
VS 2022 Preview
IDE version
No response
Nuget packages
- [ ] CommunityToolkit.Common
- [ ] CommunityToolkit.Diagnostics
- [ ] CommunityToolkit.HighPerformance
- [X] CommunityToolkit.Mvvm (aka MVVM Toolkit)
Nuget package version(s)
8.1.0
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item
Does record represent immutability?
Does record represent immutability?
Record type is not necessarily asking all members to be immutable. It can still provide useful functions such as a nice ToString format and equal checking
I've run into this issue too when trying to work with record types. The workaround we've used is to create a new ObservableRecord type using the source from ObservableObject with one or two tweaks. Would be nice to have "official" support for records though