简体   繁体   English

从Silverlight OOB启动WPF应用

[英]Launching WPF app from Silverlight OOB

Is it possible to launch and (less important) control a WPF application from a Silverlight OOB app? 是否可以从Silverlight OOB应用程序启动和(不太重要)控制WPF应用程序? Would I need to create an Automation Server for the WPF app. 我是否需要为WPF应用程序创建自动化服务器。 Is this possible? 这可能吗?

Thanks 谢谢

If you're using silverlight 4+, using an out of browser trusted silverlight application, you have access to COM interop. 如果您使用的是Silverlight 4+,则使用不受浏览器信任的 Silverlight应用程序,则可以访问COM互操作。

For example, you can use COM interop to launch an application like excel, like here which allows not only launching, but controlling and populating information back and forth. 例如,您可以使用COM interop来启动excel之类的应用程序,例如此处 ,该应用程序不仅允许启动,而且可以来回控制和填充信息。

For your WPF application, you would likely need to create a COM library and installer for the users to run. 对于WPF应用程序,您可能需要创建一个COM库和安装程序,以便用户运行。 After that, any trusted silverlight application could access this library in order to pass commands to launch the application as well as take control or handle events in the WPF application. 此后,任何受信任的Silverlight应用程序都可以访问该库,以便传递命令以启动该应用程序以及控制或处理WPF应用程序中的事件。

See a similar example of writing a COM wrapper for launching applications here . 在此处参见编写COM包装程序以启动应用程序的类似示例。 This example launches the application from a web browser, but the idea is easily the same for your silverlight application. 本示例从Web浏览器启动该应用程序,但是对于您的silverlight应用程序来说,想法很简单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM