ConditionalAvailability (attribute): Difference between revisions

From MXMS Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
The ConditionalAvailability attribute is used to show a property only when it's attribute condition is met.
The ConditionalAvailability attribute is used to show a property only when it's attribute condition is met. The condition must be defined in the class where the condition is defined. Determination of the condition is client side only.


== Example ==
== Example ==

Revision as of 05:26, 3 April 2026

The ConditionalAvailability attribute is used to show a property only when it's attribute condition is met. The condition must be defined in the class where the condition is defined. Determination of the condition is client side only.

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.