重用 xaml 子工作流程 - 从工具箱拖放到新的 xaml 工作流程中
我有许多 xaml 子工作流程,我想在其他 xaml 工作流程中重用它们。这些子工作流使用接收和发送活动,因此用代码编写它们对于我们凡人来说是一件痛苦的事情。
我认为这是一个常见的场景,但我找不到一个很好的参考来列出完成此操作的步骤。这是我想要做的:
1-设计一个子工作流 xaml。 2- 在工具箱(VS 和托管 WF Designer)中添加具有拖放功能的条目 3-能够使用已删除子工作流程的自定义 UI,并且不显示所有包含的活动 4- 保存完成的 xaml 工作流时,子工作流将作为 xaml 的一部分另存为。
任何想法或建议将不胜感激。
谢谢, 卡斯
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
XamlServices.Save(filename, Activity);
我不这样做 。我认为这也是可能的。如果您实现 (2),则包含的活动将会出现。如果您想要自定义设计器,则必须为其创建编译类型。
You can do that using
XamlServices.Save(filename, activity);
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.
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.