将WPF应用程序转换为ASP [英] WPF app into ASP

查看:69
本文介绍了将WPF应用程序转换为ASP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以将WPF应用程序转换为ASP应用程序?还是它们完全无关的技术?XAML格式使我非常想起HTML,似乎有一种方法.

Is there any way to turn to WPF app into an ASP app? Or are they totally unrelated technologies? XAML format reminds me so much of HTML that it seems like there might be a way.

推荐答案

WPF应用程序是Windows应用程序,而ASP.Net应用程序是Web应用程序.这两个平台之间存在巨大差异,因此很难转换.在大多数情况下,由于这些平台的不同局限性和优势,甚至都不可行.

WPF app is a windows application while an ASP.Net app is a web application. These two platforms have huge differences which make it hard to convert. In most cases this isn't even feasible due to different limitations and strengths of these platforms.

为了进行查看,这是可能的,但是如果WPF应用程序执行了诸如写入本地文件系统或在用户计算机上进行某些修改的操作,那么这将无法在网络上运行.

For viewing this might be possible but if the WPF application does anything like write to the local filesystem or modify something on the user's computer this just won't work on the web.

如果该应用程序供内部使用,则可以研究XAML浏览器应用程序(XBAP).这些仅具有安全性限制,您可以通过对部署进行签名并通过域向客户端计算机传播正确的证书来绕过这些限制.关于XBAP的重要之处在于它们可以与WPF应用程序共享程序集,因此将WPF应用程序转换为XBAP并不容易.

If the application is for internal use, you could look into XAML Browser Applications (XBAP). These have only security limitations which you can bypass by signing the deployment and propagating the correct certificate to the client computers through the Domain. The great part about XBAPs is that they can share assemblies with the WPF application and so converting WPF application to an XBAP is quite trivial.

Silverlight是另一种可能性,但是WPF和Silverlight之间有很大的不同,将WPF应用程序转换为Silverlight应用程序需要的重写工作比人们最初想象的要多.Silverlight引擎建立在.Net之上,但它使用不同的虚拟机,并且与二进制文件不兼容.移植到ASP.Net上仍然要容易得多!

Silverlight is another possibility but there are quite major differences between WPF and Silverlight and turning a WPF application into a Silverlight application requires more rewriting than one might initially think. The Silverlight engine is built on top of .Net but it uses different virtual machine and isn't binary compatible. It's still easier to port to than to ASP.Net!

即使您设法将XAML转换为ASP.Net HTML,控制行为上的细微差别也会有问题.而且,如果您的WPF应用程序正在使用WPF的主要功能,例如在标签页页眉中嵌入控件或应用转换,甚至都不会尝试这样做.

Even if you would manage to convert the XAML to ASP.Net HTML you'd have problems with the minor differences in control behaviours. And if your WPF app is using the major WPF features such as embedding controls inside tab page headers or applying transformations don't even think of trying this.

这篇关于将WPF应用程序转换为ASP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆