在DataGrid中实现Button Command

Command="{Binding butCommand}"会默认查找ListViewItems中对象的属性,而你的ListViewItems中对象应该不包括butCommand属性;
可以尝试:
Command="{Binding DataContext.butCommand,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Windows}}}"(假设最外层窗体为Windows)

posted on 2014-07-08 09:37  大木哥  阅读(303)  评论(0编辑  收藏  举报

导航