When the WF designer is hosted in VS and you start a new 'Workflow Console Application' project, an empty workflow is created containing a number of useful imports and nothing else. The designer seems quite happy to swallow this workflow, but when you present the same xaml to ActivityXamlServices.Load() and use that as the basis for a new workflow/activity (WorkflowDesigner.Load()) in a hosted designer, it chokes on it with a 'NullReferenceException at System.Activities.Presentation.View.ImportDesigner.OnContextChanged()'.
Is there some VS magic involved here, or have I just screwed up?
Ok, loading the xaml into the Text property and then calling Load() worked perfectly - thanks. What I don't uynderstand is why that would be any different from using ActrivitiesXamlServices.Load() and passing the resultant Activity to the designer in the Load() method? It obviously is, but it doesn't seem as though it should be?