无法获得新的XAML 2009元的工作,为什么? [英] Can't get the new 2009 XAML primitives working, why?

查看:133
本文介绍了无法获得新的XAML 2009元的工作,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用:<一href="http://msdn.microsoft.com/en-us/library/ee792002%28VS.100%29.aspx#xaml_2009_language_primitives">2009 XAML原语

这怎么会是很好使用它们:

How it would be nice to use them:

<sapv:ExpressionTextBox xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        ExpressionType="x:String"  />

究竟发生了:

What actually happens:

类型引用无法找到名为字符串大众型

"Type reference cannot find the public type named String"

我看没有更新的命名空间的例子。我想2009年和2010年,但无济于事。这是在VS 2010 RTM。我究竟做错了什么?

The examples I see don't have updated namespaces. I tried 2009 and 2010, but to no avail. This is in VS 2010 RTM. What am I doing wrong?

推荐答案

我相信,文档页面上的关键句是这样的:

I believe the key sentence on the documentation page is this:

在WPF中,你可以使用XAML 2009新增功能,但只针对未标记编译XAML。标记编译XAML的WPF和XAML的BAML形式当前不支持XAML中2009年的关键字和功能。

In WPF, you can use XAML 2009 features but only for XAML that is not markup-compiled. Markup-compiled XAML for WPF and the BAML form of XAML do not currently support the XAML 2009 keywords and features.

所以,如果你正在编写需要在运行时通过加载的松散XAML 的XamlReader ,您可以使用这些原语。如果你正在写的XAML被编译,你不能。

So, if you're writing loose XAML that's loaded at runtime via a XamlReader, you can use these primitives. If you're writing XAML that's compiled, you can't.

这篇关于无法获得新的XAML 2009元的工作,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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