绑定XAML中的XPath语法 [英] XPath syntax within binding XAML

查看:116
本文介绍了绑定XAML中的XPath语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是使用XPath在XAML绑定语法?有没有这说明在哪里放置括号?任何MSDN页

What is the syntax for using XPath with Binding in XAML? Are there any MSDN pages which describe where to put the braces?

Visual Studio的不喜欢以下内容:

Visual Studio doesn't like the following:

<TextBlock Text="{Binding XPath=/One/Two[@id='0']/Three/@Four}" />

我要的文本的TextBlock 设置为的值属性。

推荐答案

看着的文档,应设置绑定使用嵌套的语法如下:

Looking at the documentation, you should set the binding using nested syntax as follows:

<TextBlock>
    <TextBlock.Text>
        <Binding XPath="/One/Two[@id='0']/Three/@Four" />
    </TextBlock.Text>
</TextBlock>

这篇关于绑定XAML中的XPath语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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