ConditionalAvailability (attribute)

From MXMS Wiki
Revision as of 05:25, 3 April 2026 by Bjorn (talk | contribs)
Jump to navigationJump to search

The ConditionalAvailability attribute is used to show a property only when it's attribute condition is met.

Example

public virtual bool Enabled
{
    get; set;
}

[ConditionalAvailability("Enabled", ConditionalAvailabilityMode.Equals, true)]
public virtual string ConditionalProperty
{
    get; set;
}

In de example above property ConditionalProperty will be visible only when the Enabled Property is true. If a user changes the Enabled property the ConditionalProperty becomes available immediately without first saving.