Description
The Value
property of the HideIfAttribute
class specifies the value to test against when determining whether a property should be hidden in the editor. This property is used in conjunction with the PropertyName
property to define a condition under which the associated property will be hidden from view in the editor interface.
Usage
To use the Value
property, you must first apply the HideIfAttribute
to a property within a class. Specify the PropertyName
of the property to check and the Value
to compare against. If the specified property has the specified value, the property with the HideIfAttribute
will be hidden in the editor.
Example
// Example usage of HideIfAttribute
public class MyComponent : Component
{
[HideIf("IsEnabled", false)]
public int HiddenProperty { get; set; }
public bool IsEnabled { get; set; }
}
// In this example, HiddenProperty will be hidden in the editor if IsEnabled is false.