且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何恢复:工作流设计器遇到文档问题

更新时间:2023-11-18 16:07:16

您似乎正在尝试重新托管您的工作流设计器,但它没有为您生成正确的 XAML.

It seems you're trying to re-host your Workflow Designer and it's not generating correct XAML for you.

错误找不到成员如果工作流设计器实例直接加载容器活动(序列、流程图等),而不是首先使用 ActivityBuilder,则通常会发生 in type .

如果您已经在使用 ActivityBuilder,那么您可能没有为它提供根活动命名空间.添加System.Activities.Presentation.WorkflowDesigner的正确方法是:

If you're already using an ActivityBuilder then you may have missed giving it the root activity namespace. The correct way to add System.Activities.Presentation.WorkflowDesigner is:

this.workflowDesigner = new WorkflowDesigner();
this.workflowDesigner.Load(new ActivityBuilder { Implementation = new Sequence(),
                                                 Name = "RootNamespace.RootActivity" });

正确设置 Name 后,WF 设计器将停止使用随机类型(如您的案例中的 _8684)并在保存/序列化时生成正确的 XAML.这应该可以帮助您摆脱命名空间错误.

With the Name set properly WF designer would stop using random types (like _8684 in your case) and generate correct XAML on save/serialization. This should help you get rid of the namespace errors.