TX Text Control .NET for WPF

ElseInstructionValue Property

Property|Introduced in 28.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets the value that is set by the specified action when the defined requirements of the ConditionalInstruction.Conditions array are not fulfilled and the Instruction.IsElseInstructionEnabled property is set to true.

Syntax

public object ElseInstructionValue { get; }

Examples

The following example builds a rule around an approval check box in a fillable form by using Instruction.ElseInstructionValue.

CheckFormField approvalField = new(false) { Name = "Approved" };
textControl.FormFields.Add(approvalField);
Instruction instruction = new(approvalField, Instruction.InstructionTypes.IsEnabled, true);

Console.WriteLine($"Else Instruction Value: {instruction.ElseInstructionValue}");
Console.WriteLine("Instruction is ready for use.");

Limitations

Read only.

Remarks

The value represents the elseInstructionValue parameter value of the constructor's second overload. If that overload was not used to specify an else instruction value, the property returns a default value that depends on the set Instruction.InstructionTypes property value, the related form field type and/or the Instruction.InstructionValue property:

Instruction.InstructionType property valueDefault else instruction value
Instruction.InstructionTypes.IsEnabledNegation of the Instruction.InstructionValue property value
Instruction.InstructionTypes.IsValueValidNegation of the Instruction.InstructionValue property value
Instruction.InstructionTypes.SetValue (CheckFormField)Negation of the Instruction.InstructionValue property value
Instruction.InstructionTypes.SetValue (TextFormField)String.Empty
Instruction.InstructionTypes.SetValue (SelectionFormField)String.Empty
Instruction.InstructionTypes.SetValue (DateFormField)null
Instruction.InstructionTypes.SetItems (only SelectionFormField)String[0]