We will learn how to create a composite activity
designer. We will use the metadata stored to override the designer of an activity
from the workflow activity library. Also, We will add a text box in the hosted
workflow designer to display the XAML source code while creating a workflow.
Step 1 : Creating a Designer for the TryCatch Built-in Activity
Default designer vs. Composite designer
|
Step 1 : Creating a Designer for the TryCatch Built-in Activity
We will open the starting solution for the exercise and create a designer for the TryCatch activity provided in the
Activity Library.
- Open Microsoft Visual Studio 2010 from Start | All Programs | Microsoft Visual Studio 2010 | Microsoft Visual Studio 2010.
- Open the project from last post Adding Controls to an Activity Designer
- Add
a new Activity Designer. To do this,
right-click the CustomActivities
project and select Add | New Item. In the Add New Item dialog box select the Workflow category and select the Activity Designer template. Set the name to MyTryCatchFinally.xaml
and click Add. The activity designer
will open automatically.Adding an Activity Designer (C#)Adding an Activity Designer (Visual Basic)
- Create
the designer for the TryCatch
built-in activity. To do this, open the MyTryCatchFinally
in the XAML editor, and add the
following code (shown in bold)
removing the
tags. XAML<sap:ActivityDesigner ...><StackPanel><Border BorderBrush="Green" BorderThickness="4" CornerRadius="5"><sap:WorkflowItemPresenter Item="{Binding Path=ModelItem.Try, Mode=TwoWay}" HintText="Insert Try Activities Here"/></Border><Border BorderBrush="Black" BorderThickness="4" CornerRadius="5"><sap:WorkflowItemPresenter Item="{Binding Path=ModelItem.Finally, Mode=TwoWay}" HintText="Insert Finally Activities Here"/></Border></StackPanel></sap:ActivityDesigner ...> - Save the activity and close the file.
Creating the activity designer
|
No comments:
Post a Comment