Back to API Reference
Class

VariantAttribute

sealed
Inherits:Attribute

A discriminated-union editor for a parameter field: pipe-separated Label=subtype options (e.g. "Color=color:#000000FF|Swatch=enum:@paints"), where a subtype is a literal, a scalar type (color/float/int/bool), or an enum:@provider. Compound values can name their enum discriminator; its declaration order must match the option order.

public string Spec{ get }
public string Discriminator{ get; set }

Name of the enum field or readable property that stores the active option for a compound value. The enum declaration order must match the option order in Spec.

[ctor]public VariantAttribute()