Question

I wish I could understand how the loading of xaml files into rehosted designer works. Depends of xaml definition I get different results.

  1. Xaml, root node in the file is Activity that cointans flowchart. Here it's enough using desinger.Load(xamlFileName) with (new DesignerMetadata).Register() after creating the designer (anyone know what kind of magic is that?) In the designer I get workflow that looks like in visual studio editor.
  2. Xaml, root node is Flowchart itself. The same steps give me only one, bare activity in the designer. I tried wrapping workflow in activity builder according to this(I have a similar problem). There are no problems with assemblies(at least I think so), no exceptions. I can't make it work like in previous point.

Is there any difference between xaml saved in visual studio and xaml saved in rehosted designer?
ActivityXamlServices.Load sometimes returns DynamicActivity, sometimes the target workflow. What does it depend on?

Thank you for any support.

Was it helpful?

Solution

Turns out that it depends on the argument given to the rehosted designer. If I start with new Flowchart, the root node in xaml will be flowchart. When loading such file later to the designer you dont need to wrap it. If you started with ActivityBuilder you might need to use WorkflowInspectionServices to get the workflow before loading xaml.
Sometimes to show workflow properly in the designer you need to use (new DesignerMetadata).Register() from proper assembly, but its not always necessary, I'm not sure what does it depend on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top