Flowchart.Variables Property

.NET Framework (current version)
 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the collection of T:System.WorkflowModel.Variable objects associated with the Flowchart, which are available to share state across the child activities contained within the Flowchart.

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

public Collection<Variable> Variables { get; }

Property Value

Type: System.Collections.ObjectModel.Collection<Variable>

The collection of variables.

The following code sample demonstrates using Variables in a Flowchart activity. This example is from the Fault Handling in a Flowchart Activity Using TryCatch sample.

Flowchart flowChart = new Flowchart
{
    DisplayName = "Promotional Discount Calculation",
    Variables = {discount, promo, numberOfKids},
    StartNode = promoCodeSwitch,
    Nodes = 
    { 
        promoCodeSwitch, 
        singleStep, 
        mnkStep, 
        mwkStep, 
        discountDefault, 
        flowDecision, 
        discountApplied, 
        discountNotApplied
    }
};

.NET Framework
Available since 4.0
Return to top
Show: