<sap:WorkflowItemPresenter Margin="3" Item="{Binding Path=ModelItem.Pre, Mode=TwoWay}" HintText="Drop activity here"/> The Activities collection uses the WorkflowItemsPresenter to create a design surface that can hold a collection of activities. In the XAML you see how you can create a design surface that looks similar to the Sequence. XAML <sap:WorkflowItemsPresenter Margin="3" Items="{Binding Path=ModelItem.Activities}" HintText="Drop activities here"> <sap:WorkflowItemsPresenter.SpacerTemplate> <DataTemplate> <Grid> <Path Fill="Red" Width="20" Height="30" HorizontalAlignment="Center" Data="M 0,10 l 20,0 l -10,10 Z" /> </Grid> </DataTemplate> </sap:WorkflowItemsPresenter.SpacerTemplate> <sap:WorkflowItemsPresenter.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Vertical"/> </ItemsPanelTemplate> </sap:WorkflowItemsPresenter.ItemsPanel> </sap:WorkflowItemsPresenter> Press CTRL+SHIFT+B to build the solution Task 6 Linking the Activity Designers to the Activity – Now you have designers for your activities but they will not be used until you link the designers to your custom activities. There are two ways to do this, a declarative way and an imperative way. We will use the declarative approach. Open DiagnosticTrace.cs (C#) and add the following namespace directives C# using HelloWorkflow.Activities.Designers; Add the Designer attribute to the class as shown
<sap:WorkflowItemPresenter Margin="3" Item="{Binding Path=ModelItem.Pre, Mode=TwoWay}" HintText="Drop activity here"/> The Activities collection uses the WorkflowItemsPresenter to create a design surface that can hold a collection of activities. In the XAML you see how you can create a design surface that looks similar to the Sequence. XAML <sap:WorkflowItemsPresenter Margin="3" Items="{Binding Path=ModelItem.Activities}" HintText="Drop activities here"> <sap:WorkflowItemsPresenter.SpacerTemplate> <DataTemplate> <Grid> <Path Fill="Red" Width="20" Height="30" HorizontalAlignment="Center" Data="M 0,10 l 20,0 l -10,10 Z" /> </Grid> </DataTemplate> </sap:WorkflowItemsPresenter.SpacerTemplate> <sap:WorkflowItemsPresenter.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Vertical"/> </ItemsPanelTemplate> </sap:WorkflowItemsPresenter.ItemsPanel> </sap:WorkflowItemsPresenter> Press CTRL+SHIFT+B to build the solution Task 6 – Linking the Activity Designers to the Activity Now you have designers for your activities but they will not be used until you link the designers to your custom activities. There are two ways to do this, a declarative way and an imperative way. We will use the declarative approach. Open DiagnosticTrace.cs (C#) and add the following namespace directives C# using HelloWorkflow.Activities.Designers; Add the Designer attribute to the class as shown
IntroToWF.docx