{Binding PropertyName} 和 {Binding Path=PropertyName} 的区别 [英] Difference between {Binding PropertyName} and {Binding Path=PropertyName}

查看:37
本文介绍了{Binding PropertyName} 和 {Binding Path=PropertyName} 的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一个项目中看到过这两种风格,我想知道它们之间是否有任何语义差异,或者是否会推荐任何一种风格以及为什么.

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 属性分配值.换句话说,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

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