Version

Enumeration Property

Gets/sets an object implementing System.Collections.IEnumerable which contains a list of value options. Note, this property defaults to a null (Nothing) value.
Syntax
'Declaration
 
Public Property Enumeration As IEnumerable
public IEnumerable Enumeration {get; set;}
Remarks

Enumeration constraints data value to be one of the elements that are part of the enumeration. In other words the value being validated by this ValueConstraint object will not be considered valid if the value is not part of this enumeration.

Note: The Enumeration is IEnumerable interface type. Therefore it can be set to any object that implements this interface, including Array, ArrayList etc...

Example
The following code sets the Enumeration property of a ValueConstraint to an Array containing A, B and C strings. The ValueConstraint is assigned to XamTextEditor. The editor will make sure that the entered value is A, B or C (upper case). If any other value is entered then when the user attempts to leave the editor, the editor will take action based on InvalidValueBehavior setting which in the following code snippet is set to DisplayErrorMessage.

<!--This editor will make sure that the text entered is A, B or C (upper case)-->
<igEditors:XamTextEditor x:Name="textEditor4" InvalidValueBehavior="DisplayErrorMessage" >
    
<igEditors:XamTextEditor.ValueConstraint>
        
<igEditors:ValueConstraint>
            
<igEditors:ValueConstraint.Enumeration>
                
<x:Array Type="{x:Type system:Object}">
                    
<system:String>A</system:String>
                    
<system:String>B</system:String>
                    
<system:String>C</system:String>
                
</x:Array>
            
</igEditors:ValueConstraint.Enumeration>                    
        
</igEditors:ValueConstraint>
    
</igEditors:XamTextEditor.ValueConstraint>
</igEditors:XamTextEditor>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also