WF4.0 与 Silverlight 4.0 集成
我对 Silverlight 和 WF(都是 4.0 版本)都很陌生,我想知道我们是否可以将 WF4.0 与 Silverlight 4.0 集成,这样当我们单击 sliverlight UI 中的某个按钮时,应该执行工作流程并输出工作流的最终活动将显示在 Silverlight 屏幕中。如果可以完成,请向我提供一些链接或任何教程,我可以在其中了解这一点并开始实施。
提前致谢。
I am new to both Silverlight and WF (both 4.0 version), i was wondering if we can integrate WF4.0 with Silverlight 4.0 in such a way that, when we click on some button in sliverlight UI the workflow should be executed and the output from the final activity of the workflow is displayed in the Silverlight screen. If it can be done then please provide me with some link or any tutorial where i can learn about this and start implementing.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在 WF 4.0 中,您可以通过 WCF 端点启动(或推进)工作流。因此,如果您可以从 Silverlight 应用程序调用 WCF 端点,您应该能够非常轻松地完成此操作。 Microsoft 的 WF 开发人员中心上有大量信息。
假设您使用的是 Visual Studio 2010,您可以使用非常简单的 Silverlight 启动并运行 -> WF 示例非常快...
可能具有挑战性的一个领域是修改 WCF 服务绑定以与 Silverlight 兼容;也许首先在服务器端项目中创建一个与 Silverlight 兼容的 WCF 服务,然后创建一个 WF WCF 端点并查看生成的代码和示例。配置以了解如何将所有内容组合在一起。
MSDN Endpoint 博客也是了解有关 WF 和 WCF 的更多信息的有用资源(尤其是使用新的样式轻量级 REST 样式“WCF Web HTTP”绑定,这可能更适合 Silverlight 客户端使用,
我假设您不想在 Silverlight 应用程序本身内托管工作流,因为 WF 是一个完整的 .Net。我确信您可以编写自己的在 Silverlight 中运行的轻量级工作流框架,但考虑到工作流通常是多用户、服务器端问题,这可能不是很有用的问题。
In WF 4.0 you can have workflows started (or progressed) by WCF endpoints. Therefore, if you can call the WCF endpoint from your Silverlight application you should be able to do this quite easily. Lots of information on Microsoft's WF Developer Centre.
Assuming you are using Visual Studio 2010, you can get up and running with a very simple Silverlight -> WF example very quickly...
One area that might be challenging is modifying the WCF service bindings to be compatible with Silverlight; perhaps create a Silverlight-compatible WCF service in your server-side project first, then create a WF WCF endpoint and look at the generated code & config to see how to put things together.
The MSDN Endpoint blog is also a useful resource for learning more about WF and WCF (especially with the new style lightweight REST-style 'WCF Web HTTP' bindings, which might be more suitable for consumption by a Silverlight client.
I am assuming that you don't want to host the workflow inside the Silverlight app itself, as WF is a full .Net framework component rather than being Silverlight compatible. I'm sure you could write your own lightweight workflow framework that runs inside Silverlight, but given workflow is generally a multi-user, server-side concern this probably wouldn't be very useful concern.
我在此处找到了一个 WPF 示例示例 。希望他们能对您有所帮助,或者至少对这个主题有一个大致的了解。
I found an example with WPF here for these samples. Hope they will help you a bit or at least give a general look at this topic.
Workflow Foundation 不包含在 Silverlight 4.0 运行时中,因此不能在 Silverlight 应用程序中使用。所以 Silx 的答案与 Silverlight 完全无关。 James Websters 的答案是利用 Silverlight 的 WF 的唯一解决方案。
Workflow Foundation is not included in the Silverlight 4.0 runtime and thus cannot be used within a Silverlight app. So Silx answer do not relate at all to Silverlight. And James Websters answer is the only solution to make use of WF from Silverlight.
您不能将 WF 与 silverlight 一起使用...唯一的方法是,您可以调用 WCF 服务来访问 WF,如 James Webster 所解释的那样。
You cant use WF with silverlight.... the only way is , You can call WCF service to access WF as explained by James Webster.