【发布时间】:2013-03-22 07:20:52
【问题描述】:
谁能解释一下为什么在设置绑定时,有时你会在绑定路径周围加上引号 -
<myObject.myProperty>
<Binding Path="myData" />
<myObject.myProperty/>
有时没有 -
<myObject myProperty="{Binding Path=myData}" />
?
微软 (http://msdn.microsoft.com/en-us/library/ms752059.aspx#xaml_syntax_in_brief) 状态 -
"An attribute syntax names the property that is
being set in attribute syntax, followed by the
assignment operator (=). The value of an attribute
is always specified as a string that is contained
within quotation marks."
但是这里我们总是在不带引号的情况下指定Binding元素的Path属性。我是不是不太了解 {} 语法?
【问题讨论】:
标签: wpf data-binding binding syntax path