想在 Asp.net Web 应用程序上运行 WPF 应用程序。
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16670197/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Want to run WPF application on Asp.net web application.
提问by vitall
I want to run my WPF application on asp.net web application. Actually I have a WPF page.xaml which contain the image viewer, which actually open image and edit it as required. Now I want to embed that in my Asp.net Web application. I have a asp.net web application user control on which I want that WPF stuff. I research on it on the internet, I find a way that we first publish the WPF application on the IIS server and then past the URL in asp.net web application page iframe. as I follow this below link:
我想在 asp.net web 应用程序上运行我的 WPF 应用程序。实际上我有一个包含图像查看器的 WPF page.xaml,它实际上打开图像并根据需要对其进行编辑。现在我想将它嵌入到我的 Asp.net Web 应用程序中。我有一个 asp.net web 应用程序用户控件,我想要 WPF 的东西。我在互联网上研究它,我找到了一种方法,我们首先在 IIS 服务器上发布 WPF 应用程序,然后在 asp.net Web 应用程序页面 iframe 中传递 URL。当我按照以下链接进行操作时:
http://msdn.microsoft.com/en-us/library/aa970060.aspx#deploying_a_xbap
http://msdn.microsoft.com/en-us/library/aa970060.aspx#deploying_a_xbap
now I not want to follow this approach. I want an alternate way of this. Is there any way to handle this scenario. If yes then how can we achieve this?
现在我不想遵循这种方法。我想要另一种方式。有什么办法可以处理这种情况。如果是,那么我们如何实现这一目标?
回答by ppetrov
Yes there's a better way: you can use Silverlight (basically it's a C# equivalent to Flash).
是的,有更好的方法:您可以使用 Silverlight(基本上它是与 Flash 等效的 C#)。
Even if Silverlight is quite the same as WPF, there is some differences due to the fact that silverlight is made for web. So you'll have to make some changes to your application.
即使 Silverlight 与 WPF 完全相同,但由于 Silverlight 是为 Web 设计的,因此存在一些差异。因此,您必须对应用程序进行一些更改。
About integrating it in your page, it seems quite simple:
You can use an objecthtml element (as you would do with Flash)
Here are some links about that:
关于将它集成到您的页面中,这似乎很简单:您可以使用objecthtml 元素(就像使用 Flash 一样)这里有一些关于此的链接:
回答by Caleb
2 years later, a possible answer appears! Maybe someone else will see this and get some use out of it.
2年后,一个可能的答案出现了!也许其他人会看到这个并从中得到一些利用。
I have been hearing rumors that it is possible to run your WPF application in a browser, it's called an XBAP?
我一直听说可以在浏览器中运行 WPF 应用程序,它被称为 XBAP?
https://msdn.microsoft.com/en-us/library/aa970060%28v=vs.110%29.aspx
https://msdn.microsoft.com/en-us/library/aa970060%28v=vs.110%29.aspx
I am about to give this a try myself, I'll update this answer with any limitations I find.
我要自己尝试一下,我会用我发现的任何限制更新这个答案。

