Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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?
Posted
Updated 16-Apr-12 0:05am
v4

1 solution

you could, in your viewmodel bind the SelectedValue of the listbox to a property.

When you select the button you would file a delegate command with a payload of the listbox item. This item can then be placed into the viewmodel property for the bound selectedvalue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900