Windows Workflow Foundation .Net 4.0 and I'm creating using code some custom activities and a flowchart that use it.
At the end I serialize the flowchart with this command: XamlServices.Save(@"filename.xaml", Workflow);
where "Workflow" is a System.Activities.Statements.FlowChart object crated using basic constructor with all the nodes connected by their "Next" field.
The process seems to Works but whene I get the output, viewing it as text I get a Workflow without xmlns declarations and without graphic elements (such as ) and when I load it with Visual Studio, the designer adds the graphic in the wrong mode. I mean that every activity is connect with the previous and with the next using the same graphic point.
Where is that I'm wrong?

Thanks
This is my Corresponding XAML (before loading with Visual Studio): http://pastebin.com/s3DVQ3hK