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