展示活动进设计师? [英] Show an activity into the designer?

查看:133
本文介绍了展示活动进设计师?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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);

这篇关于展示活动进设计师?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆