[英]Window workflow foundation 4.0 (WPF): How to change an activity location in a Flowchart workflow by code
I use rehosting workflow designer ( https://msdn.microsoft.com/en-us/library/dd489419%28v=vs.100%29.aspx ) to load a Flowchart workflow in my application. 我使用重新托管工作流设计器( https://msdn.microsoft.com/zh-cn/library/dd489419%28v=vs.100%29.aspx )将Flowchart工作流加载到我的应用程序中。
Flowchart flowchart = this.CreateFlowchart();///Create a Flowchart workflow
WorkflowDesigner wd = new WorkflowDesigner();
wd.Load(flowchart);
How should I do to change an activity location in the Flowchart? 如何更改流程图中的活动位置?
This is certainly not a trivial task. 这当然不是一件容易的事。
You effectively need to alter the location of the model item via the view state service. 您实际上需要通过视图状态服务来更改模型项的位置。
wd.Context.Services.GetService<ViewStateService>().StoreViewStateWithUndo(modelItem, "ShapeLocation", new Point(20,20));
Have a read of this article which explains view state far better than I can. 阅读这篇文章,它比我能更好地解释视图状态。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.