【发布时间】:2013-03-08 09:36:11
【问题描述】:
当我们在嵌套的 XAML 中编写时,为什么绑定语法会有所不同。例如:
<extensibility:CommandBehavior
Command="{Binding SelectionChanged}"
CommandParameter="{Binding ElementName=modeItemsListBox,Path=SelectedItems}" >
在上面的示例中,我有 CommandParameter 有 ElementName 和 Path 没有任何引号。
但同样可以写成:
<extensibility:CommandBehavior
Command="{Binding SelectionChanged}">
<extensibility:CommandBehavior.CommandParameter>
<Binding ElementName="modeItemsListBox"="SelectedItems" />
</extensibility:CommandBehavior.CommandParameter>
</extensibility:CommandBehavior>
ElementName 和 Path 都在引号内。这只是不一致还是我缺少一些层次结构?
【问题讨论】: