I am using the base project https://github.com/orosandrei/Rehosted-Workflow-Designer
This shows how a workflow designer can be created using roslyn and created with either a c# expression editor or a vb expression editor. Unfortunatley it does not pick up the editor when an existing workflow is loaded even thos it does put in the attribute sap2010:ExpressionActivityEditor.ExpressionActivityEditor="C#"
the key to it creating new ones is
_expressionEditorServiceVB = new VbExpressionEditorService(); _wfDesigner = new WorkflowDesigner(); _wfDesigner.Context.Services.GetService).TargetFrameworkName = new System.Runtime.Versioning.FrameworkName(".NETFramework", new Version(4, 5)); _wfDesigner.Context.Services.GetService().LoadingFromUntrustedSourceEnabled = true; _wfDesigner.Context.Services.Publish(_expressionEditorServiceVB);
//associates all of the basic activities with their designers new DesignerMetadata().Register();
//load Workflow Xaml _wfDesigner.Load(sourceFile);
here it adds the suitable IExpressionEditorService based service before the DesignerMetdata is registered. How can I detect and load the suitable workflow editor and a WPF friendly style? I realize I could look at the xml before loading and search for the attribute and set it up. But that seems the wrong way to do it, not that I have much experience of WPF yet.