展示活动进设计师?设计师

由网友(空虛de心)分享简介:我有一个示例工作流应用程序,只需要展示活动上,我们是哪一步了演出。I've a sample workflow application, which only have to display an activity an show on which step we are.现在的问题是,当我打开我的活动是这样的:...

我有一个示例工作流应用程序,只需要展示活动上,我们是哪一步了演出。

I've a sample workflow application, which only have to display an activity an show on which step we are.

现在的问题是,当我打开我的活动是这样的:

The problem is that when I load my activity like this:

TestWorkflow workflow = new TestWorkflow();
_workflowApplication= new WorkflowApplication(workflow );
_workflowDesigner = new WorkflowDesigner();
_workflowDesigner.Load(workflow );
uxGridWorkflowHoster.Children.Add(_workflowDesigner.View);

我得到在我的盒子只有根元素序列。如何改变这种状况?

I'm getting only the root element "sequence" in my box. how to change that?

我得到的视觉工作室

I get that on visual studio

和我的应用程序,我只看到:

And in my app, I see only that:

感谢您!

推荐答案

问题是,TestWorkflow没有与之相关联的设计师,设计图面并没有意识到TestWorkflow是组成了一个活动其他活动,并且它应该显示其实施的根,而不是TestWorkflow活动本身。

The problem is that TestWorkflow doesn't have a designer associated with it, and the design surface doesn't realize that TestWorkflow is an Activity that is composed out of other activities, and it should display the root of its implementation rather than the TestWorkflow activity itself.

我不知道对付它的最好方法,但我用下面的技巧。它得到TestWorkflow的第一个活动(根),并把它封装在一个ActivityBuilder。

I don't know the best way to deal with this, but I've used the following hack. It gets the first activity (the root) of TestWorkflow and wraps it in an ActivityBuilder.

var rootActivity = WorkflowInspectionServices
                       .GetActivities(new TestWorkflow())
                       .FirstOrDefault();

var builder = new ActivityBuilder
              {
                  Implementation = rootActivity,
                  //Name = PartType.Name (whoops, should have cut that out)
              };
_workflowDesigner.Load(builder);
阅读全文

相关推荐

最新文章