Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a property in a ViewModel that I want to affect a Checkbox, but the Checkbox is displayed as a part of a ListViewItem, so I want it to also affect ListViewItem.IsSelected. Here is my current xaml:
CSS
<CheckBox IsChecked="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListViewItem}}}" />

My DataContext has a property called IsSelected that I want to control the other two.

How do I bind it to the ListViewItem.IsSelected, so that all three stay in sync?
Posted
Updated 5-Nov-13 5:43am
v4
Comments
Matt T Heffron 4-Nov-13 15:51pm    
I take it that what you've shown doesn't work.
What is the current behavior?
Member 10379286 5-Nov-13 11:43am    
See updated question.

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