Trigger SelectedIndex changed whilst clicking on any control within a ListBoxItem area

前端 未结 4 888
广开言路
广开言路 2020-12-18 11:26

I\'ve a data template for ListBoxItem which contains of few buttons, and few custom controls like Grid or Chart. Each button is bound to an appropriate command handler, Sel

4条回答
  •  梦毁少年i
    2020-12-18 12:01

    If you are only interested in the item 'underneath' the data template you can use a CommandParameter with a the binding as a argument.

    CommandParameter={Binding}

    This will pass the current item as a parameter to the command, so no need to track the selected item.

提交回复
热议问题