StringConditionExpression

What it is

StringConditionExpression is used to evaluate a String property (of field or variable). Depending on the outcome, the result will then be either String1 or String2.

Code example

public StringProperty StringExample1 => StringProperty(description: "first example");
public StringProperty StringExample2 => StringProperty(description: "second example");

public ReadOnlyStringProperty StringResult
{
    get
    {
        return CalculatedStringProperty(() => 
            StringExample1.IsEqualTo(StringExample2).IsTrueElse(StringExample1, StringExample2));
    }  
}

 

Explanation of the example

Line 9 evaluates if StringExample1 is equal to StringExample2.
If so, StringExample1 will be assigned to the CalculatedStringProperty StringResult, otherwise StringExample2 will be assigned to StringResult.