I have a custom property attribute that lets callers mark a field as read-only.
I’m able to set it up such that it accepts a boolean parameter as to whether or not to to actually make the field readonly, but what I want to do is pass in the value of one of another property as that argument.
Example:
bool CanEditCount = true;
[ReadOnly(!CanEditCount)]
int Count = 0;
This doesn’t appear to work. The compiler gives me an error saying the parameter must be static.
Is there any way I can drive this readonly attribute at the instance level?