I finally got an example working where I am using a pure XAML (no code) workflow definition and also using a base class. This took a bit of research and filling in the blanks. I was surprised that Visual Studio doesn't seem to support the XAML-only stuff... sigh. And when I got is working, the designer refused to display it, so I have to stick to the XML Editor going forwards. (I haven't checked the 3.5 fixes yet, xfingers!)
First I created the workflow custom base class as a csharp class, I created my custom activity. Next, in a different project, I let Visual Studio create a XAML file for me (it is important to do the actual workflow definition in a different project, do not optimize this). Then I edited it, and deleted the code behind. Here is the summary of the manual editing steps:
- Remove the x:Class attribute
- Change the initial tag from the current workflow name to the name of your base workflow class. Ensure you add a namespace tag i.e. "ns0"
- define the namespace instead of using http instead using clr-namespace (see below) and after that provide the fully qualified namespace and assembly for the workflow base class. You need not apply a strong name, but that is what I usually do.
<ns0:MyBaseWorkflow x:Name="workflow1" InProp1="{x:Null}"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ns0="clr-namespace:My.Workflow.Activities;Assembly=My.LeadImport.Workflow.Activities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=12345">
<ns0:MyCustomActivity Prop1="Validation" Prop2="ValidateStep"
x:Name="myActivity1"
xmlns:p3="http://schemas.microsoft.com/winfx/2006/xaml/workflow" />
</ns0:MyBaseWorkflow>