问题描述
我有一个列表框,它的项目包含button,textbllock.我已成功将按钮的命令绑定到Viewmodel,并在该listboxitem中单击button时获得了listboxitem的索引.现在的问题是,当我单击listboxitem内的按钮时,没有选择listboxitem.
仅当我单击按钮框和文本块外部的listboxitem区域时,才选择listboxitem.
当我单击列表框项目中的按钮时,如何使列表框项目处于选中状态?
I have a listbox, its items contain button, textbllock .I successfully binded the command of button to Viewmodel,and get index of listboxitem when click button inside that listboxitem. now the problem is when I click the button inside listboxitem,the listboxitem did not selected.
listboxitem is selected only when I click the area of listboxitem outside button and textblock.
how can I make listboxitem selected when I click button inside this listboxitem ? is there any simple solution to do that?
推荐答案
这篇关于单击内部的按钮时,使列表框处于选中状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!