Open sandboxFocus

Property ValueProperty

ValueProperty

Gets the Value property, which holds the value of the case that the union currently carries, or null when the union has no such property. The compiler synthesizes the property for a union declaration, and the language requires the attribute form to have one, so the value is null only for a union that the compiler reports as ill-formed, which the code model of a design-time session does see.

Declaration
IProperty? ValueProperty { get; }
Property Value
Type Description
IProperty
Remarks

The property is the one that the compiler resolves, which is not necessarily declared by the union itself: the attribute form may inherit it from a base type, and a union that has a union member provider interface declares it on that interface.