你能将整个对象绑定到XAML中的CommandParameter吗?

Jos*_*osh 8 c# silverlight xaml

我在列表框中有一个链接按钮,它接收一个对象列表.我正在使用ListBox.ItemTemplate和DataTemplate来布局列表框项.我可以绑定当前绑定到linkbutton命令参数的整个对象吗?我试过用了

CommandParameter={Binding Data}

CommandParameter={Binding DataItem}

但我总是在输出中得到"Data"或"DataItem"不是所述对象的属性的错误.这甚至可能吗?

Tal*_*ner 17

试试这个

CommandParameter = {Binding}

它将绑定到用于生成项目的当前对象