索引器中的子表达式?

时间:2012-09-11 18:28:26

标签: wpf data-binding

Path=[Items[0].Name]

有可能吗?

我之所以要问,因为这篇文章How to save the IsExpanded state in group headers of a listview似乎暗示这是可能的。但是,我无法让它工作或看到任何声称可能的文档。

1 个答案:

答案 0 :(得分:0)

该示例应该没有方括号。

{Binding Path=Items[0].Name}

在其他情况下,您可能需要使用Binding的Source属性。例如:

{Binding Path=Name, Source={Binding Path=Items[0]}}