如何在WEB应用程序中使用WPF用户控件? [英] How do I use WPF User Control in WEB application?

查看:122
本文介绍了如何在WEB应用程序中使用WPF用户控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello,

I have created WPF User Control Library project which contains a textbox with Spellcheck property enabled. I want to use this TEXTBOX user Control in web form so that it does spell check in realtime ? Is it possible?


Any help is appreciated. Pls advise.

Thank you.

推荐答案

没有。这是不可能的...

请注意,你在谈论UI,它高度依赖于你用来显示的媒体/设备...

所以WPF是专为桌面显示而设计,并直接在您的操作系统上安装DirectX ...

另一方面,某个浏览器窗口中显示的Web表单无法直接访问托管浏览器的操作系统。要利用你在WPF中拥有的能力,你需要一些可以在WPF和web平台之间进行转换的层......有一个Silverlight实际上在浏览器窗口中完成所有(几乎)WPF的事情,但它并不等同于WPF方面......

如果您想要使用的是拼写检查功能,您可以将其从UI控件中分离出来并将其用作Web控件的后端服务...

也许更好的选择是谷歌为一个适合网页表格的特殊拼写检查(例如jQuery有一些拼写检查插件)...

(附注) :因为今天所有现代浏览器都内置了拼写检查,你可能根本不需要任何特殊的拼写检查)
No. It is not possible...
Notice that you are talking about UI, which is highly dependent on the medium/device you use to display...
So WPF was designed for desktop display and directly uses DirectX installed on your OS...
A web form on the other hand displayed inside some browser window and has no direct access to the OS hosting the browser. To utilize the abilities you have in WPF you need some layer that can convert between WPF and the web platform...There is Silverlight that actually do all (almost) WPF things inside a browser window, but it is not equal to WPF in all aspect...
If all you want to use is the spell-checking ability you may separate it form the UI control and use it as a back-end service for your web control...
Maybe a better option is to Google for a special spell checker that fits web forms (for instance jQuery has some spell-checker plugins for that)...
(A side note: as today all modern browsers has built in spell-checking and you may not need any special spell-checking at all)


这篇关于如何在WEB应用程序中使用WPF用户控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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