.NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. The toolkit is maintained and published by Microsoft, and part of the .NET Foundation.
currently all property code generated by the analyzer are with no access modifiers, for example:
[ObservableProperty]
private bool value;
generates
public bool Value {
get => value;
set { ... }
}
but sometimes we might want an observable property with a little more privacy...
for example, some property that can only be modified by the class itself:
public bool Value {
get => value;
private set { ... } // or protected, internal... etc.
}
Overview
currently all property code generated by the analyzer are with no access modifiers, for example:
generates
but sometimes we might want an observable property with a little more privacy... for example, some property that can only be modified by the class itself:
API breakdown
Usage example
now generates
Breaking change?
No
Alternatives
none, I just manually code the property instead of using
ObservablePropertyAttribute
.Additional context
none
Help us help you
Yes, but only if others can assist