CommunityToolkit / CommunityToolkit/dotnet
Generate observable properties based on nested record
- Dominant language
- C#
- Stars
- 3.8k
- Forks
- 400
- PR merge metrics
- No merged PRs in 30d
Description
One disadvantage that I see with the classic observable pattern implementation is that the backing fields are accessible and visible in the intellisense even if nobody should access them directly. Have you considered to generate the observable properties based on a different input than the backin fields (e. g. a nested record)
example:
```csharp
class MyObsevablePerson
{
[ObservableFields]
private record Fields(string FirstName, string LastName);
}
```
would generate
```csharp
class MyObsevablePerson
{
private Fields _fields =new();
public string FirstName
{
get=> _fields.FirstName;
set ....
}
....
```
Contributor guide
Assessment
This issue has not been assessed yet.