Windows Metro:XAML支持XPath绑定

时间:2012-09-24 14:14:17

标签: xaml xpath windows-8 microsoft-metro

Windows Metro Programming新手。

我想将XML数据与UI XAML相关联。

可以在Windows 8 Application中定义dataProvider:

XmlDataProvider x:Key =“InventoryData”XPath =“Inventory / Books”

将UI绑定为:

  <Binding Source="{StaticResource InventoryData}"
           XPath="*[@Stock='out'] | *[@Number>=8 or @Number=3]"/>

尝试使用VS2012 RC for Windows Metro C#应用程序执行相同操作。

XAML出错:找不到类型'XmlDataProvider'。

有人可以帮忙。

1 个答案:

答案 0 :(得分:0)

XPath属性是Binding class in WPF xaml的一部分。 metro Binding class没有此属性。有一个示例说明如何扩展您可以移植到metro的here的WPF实现。