This sample shows how to use the ExpressionTextBox in a custom activity designer. The custom activity,
MultiAssign, assigns two string values to two string variables. Some ExpressionTextBox controls bind to InArguments and some bind to OutArguments.
ArgumentToExpressionConverter is the type converter used when binding expressions to arguments. The
ConverterParameter must be set to
Out as appropriate.
InOut is not supported.
UseLocationExpression attribute is used on
OutArguments to specify that the expression should be an L-value ("left value" or "location value") expression. In most cases, an L-value expression is a valid Visual Basic identifier used to indicate that the
OutArgument being returned is a variable or argument name.
MaxLines attribute is set to one in this example and
MinLines is not set. This indicates that the ExpressionTextBox is a fixed size of one line regardless of the amount of text typed by the user. To allow the ExpressionTextBox to grow to fit user input, set
MaxLines greater than
An ExpressionTextBox can only be bound to arguments, and cannot be bound to CLR properties.
To use this sample
Using Visual Studio 2010, open the ExpressionTextBoxSample.sln file.
To build the solution, press CTRL+SHIFT+B.
To run this sample
Add a new Workflow Console Application to the solution.
Add a reference to the ExpressionTextBoxSample project from the new Workflow Console Application project.
Build the solution.
Drag the MultiAssign activity from the toolbox and drop it into the workflow.
The samples may already be installed on your machine. Check for the following (default) directory before continuing.
If this directory does not exist, go to Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4 to download all Windows Communication Foundation (WCF) and WF samples. This sample is located in the following directory.