Class EnabledWhenAttribute
- Namespace
- OFT.Attributes
- Assembly
- OFT.Attributes.dll
Keeps the property editable only when the specified source property's value matches one of the provided values; otherwise the editor is disabled (greyed out) in the settings UI. Mirrors VisibleWhenAttribute but disables the editor instead of hiding the row — use this when the property should stay visible so the user knows it exists, yet cannot be changed in the current mode.
Added in ATAS 8.0.15.
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class EnabledWhenAttribute : Attribute
- Inheritance
-
objectAttributeEnabledWhenAttribute
- Extension Methods
Constructors
EnabledWhenAttribute(string, params object[])
Initializes the attribute.
public EnabledWhenAttribute(string propertyName, params object[] values)
Parameters
propertyNamestringName of the source property whose value controls the editable state.
valuesobject[]Allowed values of the source property for this property to be editable.
Properties
PropertyName
Name of the source property whose value determines the editable state.
public string PropertyName { get; }
Property Value
- string
Values
The set of values for which this property is editable. If the source property's current value is in this set, the property is editable; otherwise its editor is disabled (greyed out).
public object[] Values { get; }
Property Value
- object[]