While Activity Designer


The While activity executes the activity contained in its Body while the specified P:System.Activities.Statements.Condition evaluates to true. The contained activity may never execute. If you want the contained activity to be executed at least once, use the DoWhile activity instead.

The following table shows the most useful While activity properties and describes how they are used in the designer.

Property NameRequiredUsage
DisplayNameFalseSpecifies the friendly name of the While activity designer in the header. The default value is While. The value can be edited in the Properties window or directly on the activity designer header.

Although the DisplayName is not strictly required, it is a best practice to use one.
BodyFalseContains the activity to execute while the P:System.Activities.Statements.Condition evaluates to true.
P:System.Activities.Statements.ConditionTrueContains the Visual Basic expression that is evaluated to determine whether the activity in the Body is to be executed.

Control Flow