如何从GroupStyle.HeaderTemplate访问列表框项的datacontext?

时间:2012-02-10 17:47:12

标签: wpf listbox groupstyle

我有ListBox ...其中ItemSourceCollectionViewSource

休息一切与this link相同。

我需要从ListBox项目(或GroupItem?)DataContext访问一个属性。

我如何访问它?

1 个答案:

答案 0 :(得分:1)

假设您要绑定某些文本,请尝试以下操作:

<TextBlock Text={Binding DataContext.PropertyName, ElementName=YourListBoxName}" />
相关问题