Class VisibleWhenAttribute
- Namespace
- OFT.Attributes
- Assembly
- OFT.Attributes.dll
Makes the property visible only when the specified source property's value matches one of the provided values. Used for dynamic property visibility in the settings UI (e.g., showing/hiding properties based on a mode enum).
Added in ATAS 8.0.15.
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class VisibleWhenAttribute : Attribute
- Inheritance
-
objectAttributeVisibleWhenAttribute
- Extension Methods
Constructors
VisibleWhenAttribute(string, params object[])
Initializes the attribute.
public VisibleWhenAttribute(string propertyName, params object[] values)
Parameters
propertyNamestringName of the source property whose value controls visibility.
valuesobject[]Allowed values of the source property for this property to be visible.
Properties
PropertyName
Name of the source property whose value determines visibility.
public string PropertyName { get; }
Property Value
- string
Values
The set of values for which this property is visible. If the source property's current value is in this set, the property is shown.
public object[] Values { get; }
Property Value
- object[]