开发者

Reuse xaml sub-workflows - from toolbox drag and drop into new xaml workflow

I have a number of xaml sub-workflows that I would like to reuse in other xaml workflows. These sub-workflow use receive and send activities so writing them in code is a pain for us mortals.

I would think this is a common scenario but I can't find a good reference that would list the steps to accomplish this. Here is what I am looking to do:

1- Desing a sub-workflow xaml. 2- Add an entry in the toolbox (both VS and hosted WF Designer) with drag and drop ability 3- Ability to use a custom开发者_开发技巧 UI of the dropped sub-workflow and not display all the contained activites 4- When the completed xaml workflow is saved, the sub-workflow would be saved as part of it as xaml.

Any thoughts or suggestions would be greatly appreciatd.

Thanks, Kas


  1. You can do that using XamlServices.Save(filename, activity);

  2. It is not possible to add an entry in the toolbox from a xaml file, because only compiled type can be added to the toolbox (both in VS and rehosted designer). I suggest you have a listview or treeview instead, and implement drag and drop for this listview or treeview so that you can drag the xaml activities to the designer. (So this listview will be the substitute for toolbox.

  3. I don't think this is possible either. If you implement (2) the contained activity will appear. If you want custom designer, you will have to create a compiled type for it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜