Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

FlowSwitch<T>.Expression Property

.NET Framework 4.6 and 4.5

The expression to evaluate against the collection of Cases.

Namespace:  System.Activities.Statements
Assembly:  System.Activities (in System.Activities.dll)

public Activity<T> Expression { get; set; }

Property Value

Type: System.Activities.Activity<T>
The expression to evaluate.

The following code sample demonstrates setting the Expression property of a FlowSwitch<T> node. This example is from the Fault Handling in a Flowchart Activity Using TryCatch sample.

FlowSwitch<string> promoCodeSwitch = new FlowSwitch<string>
{
    Expression = promo,
    Cases =
    {
       { "Single", singleStep },
       { "MNK", mnkStep },
       { "MWK", mwkStep }
    },
    Default = discountDefault
};

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4
Show:
© 2015 Microsoft