{绑定属性名}之间的差异{结合路径=属性名} [英] Difference between {Binding PropertyName} and {Binding Path=PropertyName}

查看:129
本文介绍了{绑定属性名}之间的差异{结合路径=属性名}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到在同一个项目中使用这两种风格,我不知道是否有它们之间的语义差别,或任何会推荐比其他和为什么。

I've seen both styles used in the same project, and I wonder if there's any semantic difference between them, or if any would be recommended over the other and why.

推荐答案

有是没有的。

如果未指定,路径属性分配的值。换句话说,Path是有约束力的默认属性。

When not specified, the Path property is assigned the value. In other words, Path is the default property of a binding.

这就像内容属性,这是许多控件的默认属性。例如:

It's like the "Content" property, which is the default property for many controls. For example

<按钮>你好< /按钮> 相同<按钮>< Button.Content>< TextBlock的文本= 你好/>< /按钮>

希望有所帮助。

这篇关于{绑定属性名}之间的差异{结合路径=属性名}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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