更新时间: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,那么您可能没有为它提供根活动命名空间.添加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.