什么是宽松XAML的限制?宽松、XAML

2023-09-04 03:30:05 作者:你的身体已归我@

我一直在尝试用WPF和渲染严格的XAML标记在Web浏览器,也称为宽松XAML(解释的这里和这里)。

I have been experimenting with WPF and rendering strict XAML markup in a web browser, also known as Loose XAML (explained here and here).

这在我看来是显示静态内容是非常有用的。但是,它也出现能够绑定到XML数据提供者。

It strikes me as mostly useful for displaying static content. However, it also appears possible to bind to an XML data provider.

宽松XAML文件不与应用程序,它创建了以下限制编译:

Loose XAML files are not compiled with an application, which creates the following limitations:

在他们不允许外部组件 在没有使用类,code-背后(或C#) 没有双向数据绑定

什么额外的限制有哪些?

What additional limitations are there?

在我还没有找到一种方法,数据绑定到一个数据库提供者(SQL Server)的 是为了使XAML浏览器客户端计算机上所需要的.NET框架? 是搜索引擎能够询问宽松XAML适当排名 网页? I have not found a way to databind to a database provider (SQL Server) Is the .NET Framework required on the client machine in order to render the XAML in the browser? Are Search Engines able to interrogate Loose XAML to appropriately rank the pages?

编辑:我试图绑定XML数据提供Web服务(使用这的简单的例子),并都没有成功。这些发现使我进一步研究,我发现,这是不支持:该XMLDataProvider被设计成只读(换句话说,它不能提供提交修改的能力),这是不能够处理XML数据可能来自其他来源(如一个数据库记录,一个web服务消息,等等)。马太福音麦克唐纳的临WPF 的

I have attempted to bind the XML data provider to a web service (using this simple example) and have not been successful. These findings lead me to further research where I found that this is not supported: "The XMLDataProvider is designed to be read-only (in other words, it doesn't provide the ability to commit changes), and it isn't able to deal with XML data that may come from other sources (such as a database record, a web service message, and so on)." -Matthew MacDonald, Pro WPF

推荐答案

AFAIK是不可能的定义在XAML的连接字符串。所以,你不能访问你的SQL数据库。

AFAIK it's impossible to define a connection string in XAML. So you can't access your SQL db.

请注意:这是可能的数据绑定到但是,使用XmlDataProvider一个web服务。所以这可能是你可以通过...

Note: It IS possible to databind to a webservice however using XmlDataProvider. So that could be a way you could send your data through...

编辑:顺便说一句,我发现这个的的沙箱环境的功能,其中您的应用程序正在使用XBAP和松散XAML时运行列表。它有点过时,但可能是最限制仍然适用。

btw, I found this list of features of the Sandboxed environment, which your app is running in when using XBAP and loose XAML. it's a bit dated, but probably most limitations still apply.