Lou*_*hys 4 .net workflow-foundation workflow-foundation-4 activitydesigner
例如,如果您创建自己的名为Run10Times的活动,该活动会运行其子活动10次,那么您是否可以拥有一个包含用户可以将子活动放入其中的画布的设计器?
我知道如何创建标准活动设计器,并添加一个表达文本框,但不知道如何添加用户可以将子活动放到其中的画布.
您需要将WorkflowItemPresenter控件添加到您的活动设计器.
假设您有这样的活动:
[Designer(typeof(MyCompositeDesigner))]
public class MyComposite : NativeActivity
{
public Activity Body { get; set; }
protected override void Execute(NativeActivityContext context)
{
context.ScheduleActivity(Body);
}
}
Run Code Online (Sandbox Code Playgroud)
你会像这样创建设计师:
<sap:ActivityDesigner x:Class="WorkflowConsoleApplication3.MyCompositeDesigner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation">
<StackPanel>
<TextBlock Text="Activity to execute:"
Margin="6"/>
<sap:WorkflowItemPresenter Item="{Binding Path=ModelItem.Body, Mode=TwoWay}"
HintText="Drop Activity"
/>
</StackPanel>
</sap:ActivityDesigner>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
878 次 |
| 最近记录: |